<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 i>{ <br>var record = ProdRequireInfoStore.getAt(i);//循環遍歷每一行<br><br>if(record.data.StatusID=='33 '){//符合我的條件則寫入數組<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的預設展開