jQWidgets Forums

jQuery UI Widgets Forums Grid Feature request: saveState() and loadState()

This topic contains 18 replies, has 3 voices, and was last updated by  Peter Stoev 12 years, 2 months ago.

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author

  • kuberasamrat
    Participant

    I have tried in different way. Check the the below example even that is breaking.

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.classic.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.pager.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    // prepare the data
    var theme = 'classic';
    var saved_pagenum = $.jqx.cookie.cookie("jqxGrid_pagenum");
    if (undefined == saved_pagenum) saved_pagenum = 0;
    var saved_pagesize = $.jqx.cookie.cookie("jqxGrid_pagesize");
    if (undefined == saved_pagesize) saved_pagesize = 10;
    var source =
    {
    datatype: "json",
    datafields: [
    { name: 'CompanyName'},
    { name: 'ContactName'},
    { name: 'ContactTitle'},
    { name: 'Address'},
    { name: 'City'},
    { name: 'Country'}
    ],
    url: 'data.php',
    root: 'Rows',
    pagenum: saved_pagenum,
    pagesize: saved_pagesize,
    beforeprocessing: function(data)
    {
    source.totalrecords = data[0].TotalRows;
    }
    };
    var dataadapter = new $.jqx.dataAdapter(source);
    // initialize jqxGrid
    $("#jqxgrid").jqxGrid(
    {
    width: 600,
    source: dataadapter,
    theme: theme,
    autoheight: true,
    pageable: true,
    virtualmode: true,
    rendergridrows: function()
    {
    return dataadapter.records;
    },
    columns: [
    { text: 'Company Name', datafield: 'CompanyName', width: 250 },
    { text: 'Contact Name', datafield: 'ContactName', width: 200 },
    { text: 'Contact Title', datafield: 'ContactTitle', width: 200 },
    { text: 'Address', datafield: 'Address', width: 180 },
    { text: 'City', datafield: 'City', width: 100 },
    { text: 'Country', datafield: 'Country', width: 140 }
    ]
    });
    $("#jqxgrid").on("pagechanged", function (event) {
    $.jqx.cookie.cookie("jqxGrid_pagenum", event.args.pagenum);
    });
    $("#jqxgrid").on("pagesizechanged", function (event) {
    $.jqx.cookie.cookie("jqxGrid_pagesize", event.args.pagesize);
    });
    });
    </script>
    </head>
    <body class='default'>
    <div id='jqxWidget'">
    <div id="jqxgrid"></div>
    </div>
    </body>
    </html>

    Peter Stoev
    Keymaster

    Hi,

    We cannot confirm the posted behavior for the latest version.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    kuberasamrat
    Participant

    Peter,

    It is modified from phpdemos- server_side_grid_paging
    It is not working, hence the code snippet has been posted above. How can we address the problem with this feature. I have tried testing in 2.8.1 version also, still the result is same. Is it a work item for you in the next release?

    The same kind of situation is happening if we use autosavestate and autoloadstate also as I have mentioned in the previous posts in this thread. I am not able to reproduce that behaviour in sample program because those features are not at all working in phpdemos.


    Peter Stoev
    Keymaster

    Hi kuberasamrat,

    There is no work item for that, because we are unable to reproduce it. We will continue testing and in case we find an issue, we will create a work item about it.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 4 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic.