Pagination is not enable when page load using dhtmlxgrid

JSP

</table>

mygrid = new dhtmlXGridObject(‘pref’);
mygrid.setImagePath(“/dhtmlx/codebase/imgs/dhxgrid_dhx_skyblue/”); //the path to images required by grid
mygrid.setHeader(“Portfolio,Scope Selection,Portfolio ID,Scope ID”); //the headers of columns
mygrid.setColumnIds(“portfolio,scope,portfolioID,scopeID”); //Attributes of the extended dhtmlxGrid-oriented JSON format
mygrid.setInitWidths(“150,,,*”); //the widths of columns
mygrid.setColAlign(“left,left,left,left”); //the alignment of columns
mygrid.setColTypes(“rotxt,rotxt,rotxt,rotxt”); //the types of columns
mygrid.setColSorting(“str,str,str,str”); //the sorting types
//mygrid.enableAutoWidth(true); //enable auto width mode
//hide the first column
mygrid.setColumnHidden(2,true);mygrid.setColumnHidden(3,true);

//this code enables paging and sets its skin
mygrid.enablePaging(true,10,5,“pagingArea”,true,“recinfoArea”);
//mygrid.enablePaging(true,10,10,“pagingArea”,true);
//mygrid.enablePaging(true,15,5,“recinfoArea”,true,“”);

	mygrid.setPagingSkin("toolbar","dhx_skyblue")

toolbar = new dhtmlXToolbarObject(“pagingArea”, “dhx_skyblue”);
//mygrid.changePageRelative(-1);

mygrid.setSkin(“modern”);
mygrid.init(); //finishes initialization and renders the grid on the page
//var isEmpty = isObjectEmpty(data);
// if(isEmpty)
mygrid.parse(rows,“js”); //takes the name and format of the data source
mygrid.attachEvent(“onRowDblClicked”, function(rId,cInd){
onClickUserPreference(mygrid.cells(mygrid.getSelectedId(),2).getValue(),mygrid.cells(mygrid.getSelectedId(),0).getValue(),mygrid.cells(mygrid.getSelectedId(),3).getValue())

});
}

Grid is working fine ,but not able get the pagination .when click on any grid functionality then only pagination enable.

Can you please guide how to enable the pagination on load



No records Found...

Please, try to remove:
toolbar = new dhtmlXToolbarObject(“pagingArea”, “dhx_skyblue”);

Hi

I remove the toolbar.but no change.

function loadAcc() {

		myAcc = new dhtmlXAccordion({
			parent: "accObj",
			items: [
				{id: "pref", text: "User Preference" , open: false,height: "*"},
				{id: "scopeDIV", text: "GeneralScopeTree", open: true,height: "*"}
			]
		});
		myAcc.setSizes();
	//	portfolioTree = myAcc.cells("scopeDIV").attachTree();
		//scopeTree = myAcc.cells("scopeDIV").attachTree();
		myAcc.cells("pref").attachObject("paging_container");
		myAcc.cells("scopeDIV").attachObject("a1");
	//var mygrid = myAcc.cells("pref").attachGrid();

mygrid = new dhtmlXGridObject(“pref”);
mygrid.setImagePath("/PrISMv17Theme/themes/html/PrISMv17Theme/dhtmlx/codebase/imgs/dhxgrid_dhx_skyblue/"); //the path to images required by grid
mygrid.setHeader(“Portfolio,Scope Selection,Portfolio ID,Scope ID”); //the headers of columns
//mygrid.attachHeader("#text_filter,#text_filter");
mygrid.setColumnIds(“portfolio,scope,portfolioID,scopeID”); //Attributes of the extended dhtmlxGrid-oriented JSON format
mygrid.setInitWidths(“200px,,,*”); //the widths of columns
mygrid.setColAlign(“left,left,left,left”); //the alignment of columns
mygrid.setColTypes(“rotxt,rotxt,rotxt,rotxt”); //the types of columns
mygrid.setColSorting(“str,str,str,str”); //the sorting types
//hide the columns
mygrid.setColumnHidden(2,true);mygrid.setColumnHidden(3,true);
mygrid.enablePaging(true,10,5,“pagingArea”,true,“recinfoArea”);
mygrid.setPagingSkin(“bricks”);
//toolbar = new dhtmlXToolbarObject(“pagingArea”, “dhx_skyblue”);

//mygrid.preventIECaching(false);
mygrid.setSkin(“modern”);
mygrid.init(); //finishes initialization and renders the grid on the page
//var isEmpty = isObjectEmpty(data);
// if(isEmpty)
//for Rest Browser
if (window.XMLHttpRequest)
{
req = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{ // For New IE.
req = new ActiveXObject(“MSXML2.XMLHTTP.3.0”);
}

       if (typeof keepPSAlive === "function") {
		         keepPSAlive();
                 }
    	
	    req.open("GET","<%=(request.getContextPath() + "/prefServlet?userName="+userName)%>",false);
	    req.send();
	    userPref=req.responseText;
	    //alert(userPref);
mygrid.parse(userPref,"js"); //takes the name and format of the data source
//alert(mygrid);
	// we are in callback
mygrid.sortRows(0, "str", "ASC"); // sorts grid
mygrid.setSortImgState(true, 0, "ASC"); // sets icon to sort arrow

mygrid.attachEvent(“onRowDblClicked”, function(rId,cInd){
onClickUserPreference(mygrid.cells(mygrid.getSelectedId(),2).getValue(),mygrid.cells(mygrid.getSelectedId(),0).getValue(),mygrid.cells(mygrid.getSelectedId(),3).getValue(),mygrid.cells(mygrid.getSelectedId(),1).getValue());

});

}

same problem

Please, make sure that you have a div where you include the paging bar.

If the problem still occurs for you, please, provide with a complete demo, where the issue can be reproduced locally.
Here you can find a tutorial about creating a complete demo:
docs.dhtmlx.com/auxiliary_docs__ … pport.html