Cannot show date in is_select_mode()

this is my html code

mygrid.setHeader("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,");
mygrid.setColTypes("ch,ch,ch,ch,ed,coro,coro,coro,ed,txt,ed,ed,ro,ed,ed,ed");
 mygrid.setColSorting("int,int,int,int,str,,,,str,str,int,int,int,int");
mygrid.attachHeader(",,,,#text_filter,,,,,,,#select_filter,,");
mygrid.setSkin("dhx_skyblue");
mygrid.init();
mygrid.loadXML("a.do?type=a01");
dp = new dataProcessor("a.do");
dp.init(mygrid);

this is java code

c.servlet(req, res);
String type=req.getParameter("type");
c.dynamic_loading(100);
c.event.attach(new a_Behavior());
String sql="isindex,new,isshow,ishead,title,fcolor,font,fstyle,content_text,short_content,img,sender,sdate,times,sort_index,type";
if(c.is_select_mode()){
c.render_sql("select id,"+sql+" from common_info where type='"+type+"' order by sdate desc", "id", sql);
}else{
c.render_sql("select id,"+sql+" from common_info order by sdate desc", "id", sql);
}

when the code is run ,throw the exception

java.lang.IndexOutOfBoundsException: Index: 5, Size: 0

an i change the code like that

String sql="isindex,new,isshow,ishead,title,fcolor,font,fstyle,content_text,short_content,img,sender,sdate,times,sort_index,type";
//sql the same to above
c.render_sql("select id,"+sql+" from common_info where type='a01' order by sdate desc", "id", sql);

To work correctly
why ,and how to solve this problem.
Looking forward to your help. :open_mouth:
please give me some advice.