I have a grid with paging.
First time loading, all went perfectly. I can navigate throughout the page bricks and display the records correctly.
Then, I filter the records by typing something in the grid header. Again it display the filtered records with paging bricks. The problems starts whenever I click “Page 2” on the bricks and it shows me empty grid, no records was displayed.
What went wrong here?
Below is my code, hope Support can help me solve this problem.
function fnc_onload() {
myCalendar = new dhtmlxCalendarObject(['FF_from_date', 'FF_to_date']);
myCalendar.setDateFormat("%d/%m/%Y");
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("dhtmlx/dhtmlxGrid/codebase/imgs/");
mygrid.setSkin("dhx_skyblue");
mygrid.init();
mygrid.enablePaging(true, 50, 10, "pagingArea", true, "infoArea");
mygrid.setPagingSkin("bricks");
mygrid.loadXML("new_load_data.asp");
mygrid.attachEvent("onFilterStart", function(column_indexes,column_values){
arr_hdr_ind=column_indexes;
arr_hdr_dat=column_values;
mygrid.clearAll();
mygrid.loadXML("new_load_data.asp?column_indexes="+arr_hdr_ind+"&column_values="+arr_hdr_dat);
});
}
Response.write("<rows total_count='" & intRecordCount & "' pos='" & posStart & "'>")
If IsEmpty(Request.QueryString("count")) Then
Response.Write("<head>")
strFilter = ",,#text_filter,#text_filter"
Response.Write("<afterInit>")
Response.Write("<call command='attachHeader'>")
Response.Write("<param>")
Response.Write(strFilter)
Response.Write("</param>")
Response.Write("</call>")
Response.Write("</afterInit>")
Response.write("<column id='column1' width='30' type='ro' align='center' sort='str'>")
Response.write("")
Response.write("</column>")
Response.write("<column id='column2' width='30' type='ro' align='center' sort='str'>")
Response.write("")
Response.write("</column>")
Response.write("<column id='asset_serial_no' width='100' type='ro' align='left' sort='str'>")
Response.write("Asset Serial No.")
Response.write("</column>")
Response.write("<column id='asset_desc' width='250' type='ro' align='left' sort='str'>")
Response.write("Asset Description")
Response.write("</column>")
Response.Write("</head>")
End If
intRecCtr = 1
While Not rstTable.EOF
strURLEdit = "^update.asp?serial_no=" & rstTable("asset_serial_no") & "^_self"
Response.write("<row id='" & rstTable("rec_id") & "'>")
Response.write("<cell>")
Response.write (intRecCtr)
Response.write("</cell>")
Response.write("<cell type='img'>")
Response.write ("<![CDATA[" & "edit_rec.gif" & "^" & "Edit" & strURLEdit & "]]>")
Response.write("</cell>")
Response.write("<cell>")
Response.write ("<![CDATA[" & Trim(rstTable("asset_serial_no")) & "]]>")
Response.write("</cell>")
Response.write("<cell>")
Response.write ("<![CDATA[" & Trim(rstTable("asset_desc")) & "]]>")
Response.write("</cell>")
Response.write("</row>")
intRecCtr = intRecCtr + 1
rstTable.MoveNext
Wend
Response.write("</rows>")
rstTable.Close
Set rstTable = Nothing