//>>built
define("dgrid/GridWithColumnSetsFromHtml",["./GridFromHtml","./ColumnSet","dojo/_base/declare"],function(_1,_2,_3){function _4(_5){var _6=[],_7=[],_8=[],_9=_5.getElementsByTagName("colgroup"),_a=_9.length,_b=_5.getElementsByTagName("tr"),_c=_b.length,_d=_1.utils.getNumFromAttr,_e=_1.utils.getColumnFromCell,_f,_10,_11,tr,ths,i,j,tmp;function _12(_13){_f+=_13;tmp=_7[_10];if(_f>=tmp){_6[_10][i]=_11;_f-=tmp;_10++;_11=[];}};if(_a<2){return false;}for(i=0;i<_a;i++){tmp=_d(_9[i],"span")||1;_7[i]=tmp;_6[i]=[];_8[i]=[];for(j=0;j<tmp;j++){_8[i][j]=0;}}for(i=0;i<_c;i++){_f=_10=0;_11=[];tr=_b[i];ths=tr.getElementsByTagName("th"),thslen=ths.length;for(j=0;j<thslen;j++){while(_8[_10][_f]){_8[_10][_f]--;_12(1);}tmp=_e(ths[j]);_11.push(tmp);_8[_10][_f]=tmp.rowSpan?tmp.rowSpan-1:0;_12(tmp.colSpan||1);}if(_11.length){_6[_10][i]=_11;}}if(tr){_5.removeChild(tr.parentNode);}return _6;};return _3("dgrid.GridWithColumnSetsFromHtml",[_1,_2],{configStructure:function(){var tmp;if(!this._checkedTrs){tmp=_4(this.srcNodeRef);if(tmp){this.columnSets=tmp;this._checkedTrs=true;}else{return this.inherited(arguments);}}return this.inherited(arguments);}});});