Dojo';在未被调用之前,s onforerow
我试图在DojoToolkit中做一个变通方法,通过添加一个只有宽度的虚拟行,您无法在第一行上进行colspan。创建行后,将使用onBeforeRow隐藏该行 请参考以下内容作为参考 这是我的密码:Dojo';在未被调用之前,s onforerow,dojo,dojox.grid.datagrid,dojox.grid,Dojo,Dojox.grid.datagrid,Dojox.grid,我试图在DojoToolkit中做一个变通方法,通过添加一个只有宽度的虚拟行,您无法在第一行上进行colspan。创建行后,将使用onBeforeRow隐藏该行 请参考以下内容作为参考 这是我的密码: ConfirmGridGrid = new DataGrid({ store: ConfirmGridDataStore, structure: [ [ { width: '35px'} ,{ width: '
ConfirmGridGrid = new DataGrid({
store: ConfirmGridDataStore,
structure: [
[
{ width: '35px'}
,{ width: '35px'}
,{ width: '60px'}
,{ width: '60px'}
,{ width: '60px'}
,{ width: '60px'}
,{ width: '25px'}
,{ width: '25px'}
,{ width: '40px'}
,{ width: '25px'}
,{ width: '25px'}
,{ width: '25px'}
,{ width: '240px'}
,{ width: '25px'}
],[
{ name: 'Product Code', field: 'ProductCD', width: '70px', colSpan: 2, editable: false}
,{ name: 'Product Name', field: 'ProductNM', width: '240px', colSpan: 4, editable: false}
// The rest of second column..............................
],[
// Third column..............................
]
],
onBeforeRow: function(inDataIndex, inSubRows){
inSubRows[0].invisible = true;
}
}, "ConfirmGrid");
ConfirmGridGrid.startup();
由于某些原因,未调用onBeforeRow事件。你有什么需要补充的吗?或者您是否需要进行其他事件连接以使其正常工作?
顺便说一句,我正在使用Dojo 1.9.1。我最终发现了为什么没有调用它。我把它放错地方了 我应该把它作为结构值的属性,而不是网格定义 希望这对以后的其他人有帮助
structure: [
[
{ width: '35px'}
,{ width: '35px'}
,{ width: '60px'}
,{ width: '60px'}
,{ width: '60px'}
,{ width: '60px'}
,{ width: '25px'}
,{ width: '25px'}
,{ width: '40px'}
,{ width: '25px'}
,{ width: '25px'}
,{ width: '25px'}
,{ width: '240px'}
,{ width: '25px'}
],[
{ name: 'Product Code', field: 'ProductCD', width: '70px', colSpan: 2, editable: false}
,{ name: 'Product Name', field: 'ProductNM', width: '240px', colSpan: 4, editable: false}
// The rest of second column..............................
],[
// Third column..............................
],
,onBeforeRow: function(inDataIndex, inSubRows){
inSubRows[0].invisible = true;
}
],
同样在我的情况下,将其设置为“不可见”是不够的。您需要更改css以删除填充和边框
tr.dojoxGridInvisible th
{
padding: 0px !important;
border: 0px !important;
}
tr.dojoxGridInvisible td
{
padding: 0px !important;
border: 0px !important;
}
引导我找到答案的示例代码是这个邮件列表 如何以编程方式覆盖css设置?