<div class="codetitle"> <span><a style="CURSOR: pointer" data="2524" class="copybut" id="copybut2524" onclick="doCopy('code2524')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code2524"> <br>//展开符合某个条件的行 <br>function expendRow() <br>{ <br>var i;//循环临时变量 <br>var arr = [];//要展开的行的数组 <br>for(i=0;i<prodrequireinfostore.data.length>{ <br>var record = ProdRequireInfoStore.getAt(i);//循环遍历每一行 <br><br>if(record.data.StatusID=='3'){//符合我的条件则写入数组中 <br>arr.push(i); <br>} <br>} <br>for(var j =0;j<arr.length>expander.toggleRow(arr[j]); <br>} <br><br><br>} <br><br>// 调用 当数据源加载完成的时候调用回调函数展开默认行 <br><br>ProdRequireInfoStore.load({ <br>params: { <br>dir: 'DESC', <br>start: 0, <br>limit: 20, <br>KeyWord: '' <br><br>}, <br>callback:expendRow //回调函数展开默认行 <br>}); <br></arr.length></prodrequireinfostore.data.length> </div> <br>这样当你打开gridpanel的时候就能实现,RowExpander的默认展开