Why remove pg_GridPager?

Developer
Apr 29, 2011 at 7:33 AM

Why do you remove the pg_GridPager? It's possible to make jqGrid show insert/add/remove/edit/view/search buttons in that toolbar, and removing it prevents that.

I tried removing the part that removes the item but it still wouldn't show, even though I could verify that the HTML makes it in there (using firebug). Any ideas why it doesn't show?

This is what I tried;

public static string Grid(GridControl grid)
        {
            StringBuilder sb = new StringBuilder();

            /* Create HTML Tags */
            sb.AppendLine("<table id=\"" + grid.GetGridName + "\"></table>");
            sb.AppendLine(createPager(grid.GetGridName));

            sb.Append(grid.RequiredData());

            /* Call the jQuery Grid plugin */
            sb.Append("<script language=\"javascript\">");
            sb.AppendLine("$(document).ready(function() {");

            //sb.AppendLine("jQuery.extend(jQuery.jgrid.defaults,{emptyrecords: \"&#1488;&#1497;&#1503; &#1512;&#1513;&#1493;&#1502;&#1493;&#1514;\",loadtext : \"&#1489;&#1496;&#1506;&#1497;&#1504;&#1492;...\",pgtext : \"&#1491;&#1507; {0} &#1502;&#1514;&#1493;&#1498; {1}\", recordtext: \"&#1512;&#1513;&#1493;&#1502;&#1493;&#1514; {0} - {1} &#1502;&#1514;&#1493;&#1498; {2}\"});");

            sb.Append(grid.Render());
            sb.AppendLine(";");

            // ADDED THIS
            sb.AppendLine("$('#%grid%').navGrid('#%grid%Pager',{add: true, edit:true, del: true},{}, {}, {}, {}, {});".Replace("%grid%", grid.GetGridName));

            // REMOVED THIS
            // sb.AppendLine("$(\"#pg_" + grid.GetGridName + "Pager\").remove();");
            sb.AppendLine("});");
            sb.AppendLine("</script>");
            return sb.ToString();
        }

 

Coordinator
Apr 29, 2011 at 9:40 AM

The grid's pager is one of the biggest changes in the upcoming relese.

In the next release the pager would be completely customizable allowing you to use the built-in CRUD buttons.

I can send you tidbits of the code if you need it ASAP

Developer
Apr 29, 2011 at 10:07 AM

No need to send me stuff, check it in and I can download it from the source-control?