0
我有一個jqgrid,我有第一和第二列分組,如果n行具有相同的值的列,然後它會合並(使用rowspan第一行和顯示:沒有其他行具有相同的值)。分組的子網格與網格時擴大和colasped
另外我有一個子網格there.now當我擴大網格中的任何一行時,其他行中的分組正在向左移動。
這裏是我的功能進行分組:
attrSetting: function(rowId, val, rawObject, cm) {
var attr = rawObject.attr[cm.name],result;
if (attr.rowspan) {
result = ' rowspan=' + '"' + attr.rowspan + '"';
} else if (attr.display) {
result = ' style="display:' + attr.display + '"';
}
return result;
}
我有寫一些代碼來處理這個問題,這增加行跨度按1我擴大亞格也由1每一個子網格處於摺疊狀態的時間減少,這是下面:
var rowspanValue = this.getElements("tbody>tr.ui-widget-content")[row_id - 1].getElement("[aria-describedby=idCommonGridTabledetailMainContainerPATHApp_Stream]").rowSpan;
this.getElements("tbody>tr.ui-widget-content")[row_id - 1].getElement("[aria-describedby=idCommonGridTabledetailMainContainerPATHApp_Stream]").setAttributes({ rowspan: rowspanValue + 1 });
this.getElements("tbody>tr.ui-widget-content")[row_id - 1].getElement("[aria-describedby=idCommonGridTabledetailMainContainerPATHApp_\\%CompletionAvg]").setAttributes({ rowspan: rowspanValue + 1 });
this.getElements("tbody>tr.ui-widget-content")[row_id - 1].getElement("[aria-describedby=idCommonGridTabledetailMainContainerPATHApp_\\%WeightAvg]").setAttributes({ rowspan: rowspanValue + 1 });
,但是這是行不通的,因爲只有第一行與分組有行跨度,所以如果我展開每個分組然後正常工作,對他人的問題仍然存在的第一行。
是否有任何方法可以檢測到DOM中具有相同分組的所有行,並且每次都可以設置第一行的行跨度或任何其他方式來實現它。
請建議。