Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
300
Paging Issue with Selected Row enabled
posted

I got a couple of issues and questions on how i could make the grids work better for my purpose.  I am mainly using the grid for searching (orders, customers, etc).  I then need to make the grid rows or a link within a cell selectable so that the user can view the details of that order or customer.

issue 1.

if i return lets say 16 rows from a search and set the paging to show 10 for each page.  I have the rowSelectionChangin enabled.  if i go to page 2 and then click previous it will open up the record on the first page that was inline with the previous button.  so in other words clicking previous triggered the rowSelectionChanging.  Now this only happens going from the last page to the previous and only if the last page has less rows than the previous page.  I hope this makes sense.  I can provide a link for you to look at if that would help.

With that said, i would really like to go to a more of a hyper link in the first column "View" that will trigger this rather than doing it on rowSelection.  Do you have any reccomendations on doing that.  I did see a post for that, but I am not using MVC like that post was referring to.  I am ASP.NET.

thanks Sy.

Here is my code.

 

$("#customersearch").igGrid({

        autoGenerateColumns: false,

        columns: [

        { headerText: "ID", key: "CustomerID", dataType: "string" },

        { headerText: "Name", key: "CompanyName", dataType: "string" },

        { headerText: "Address", key: "BillAddress", dataType: "string" },

        { headerText: "City", key: "BillCity", dataType: "string" }

    ],

        dataSourceType: 'json',

        dataSource: data.json_string,

        width: '100%',

        features: [

        {

            name: 'Paging',

            type: 'local',

            pageSize: 13

        },

        {

            name: 'Sorting',

            type: "local"

        },

        {

            name: 'Selection',

            mode: 'row',

            rowSelectionChanging: function (ui, args) {

                var cell = $("#customersearch").igGrid('cellAt', 0, args.row.index);

                var NewOrder = $('input[name$="hidNewOrder"]').val();

                if (NewOrder == 'False') {

                    window.open(getURLFolder() + 'customerdetail.aspx?id=' + $(cell).text(), '_self', false);

                } else {

                    create_order($(cell).text());

                }

            }

        },

        {

            name: 'Filtering',

            type: "local",

            filterDropDownItemIcons: false,

            filterDropDownWidth: 200

        }

    ]

 

Parents
No Data
Reply
  • 24671
    posted

    Hey Sy,

    Could you try setting a Height for the grid? I mean a fixed height. I suspect that what could be happening is that if you don't have a height set, and the last page has smaller number of records than the previous page (hence smaller height), when you click on the prev page, the mouse up event on which selection is hooked gets actually triggered on a row that renders once the page is changed.

    As for the second question you have described, I think you can take the same approach as described in the MVC post, but you won't have any state saving going on if you are currently relying on ASP.NET.

    What you can do is use templating basically. So you will render the template and instead of just the column text you will have "someUrl.aspx?param=${columnKey}". You can find an example about using jQuery templating here:

    http://samples.infragistics.com/jquery/grid/row-template

    Let me know if this helps. Thank you,

    Angel

Children
No Data