ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: Fraan83 on January 17, 2020, 03:00:31 pm

Title: Save sortingDir and Data on roDblclick.
Post by: Fraan83 on January 17, 2020, 03:00:31 pm
Hi paramvir,
how can i save the sorting data and sorting dir in navigate url?

for expample:
Code: [Select]
rowDblClick: function (evt, ui) {
    var id_user = ui.rowData.id_user;
    var user_name = ui.rowData.user_name;
    var navigateUrl = "newpage.aspx?id_user=" + id_user + "&username=" + user_name + "&rowIndex=" + ui.rowIndx + "&sortingdata=" + * SORTING COLUMN NAME * + "&sortingdir=" + *SORTING DIR* +";
window.open(navigateUrl, 'new window', 600, 600);

};

thank you so much for your patience
Title: Re: Save sortingDir and Data on roDblclick.
Post by: paramvir on January 17, 2020, 03:13:53 pm
All sorting data / information can be obtained from sortModel.sorter option.

https://paramquery.com/pro/api#option-sortModel
Title: Re: Save sortingDir and Data on roDblclick.
Post by: Fraan83 on January 24, 2020, 10:09:33 pm
Ok, thank you parmavir. but now there is another question: how do I load the grid with parameters saved in the qeurystring?
I tried:

 
Code: [Select]
  obj.dataModel = {

                    beforeSend: function () {
                        $(".loadingDiv").show();
                    },
                    complete: function () {
                        $(".loadingDiv").hide();
                    },
                    error: function () {
                        this.rollback();
                    },
                    data: data_grid_anagrafica,
                    location: "local",
                    sorting: "local",
                    space: true,
                    multiKey: null
                };
var sortingDir = *querystring direction variable*;
var sotringData = *querysring dataIndx variable*
obj.dataModel.sortIndx = sortingDir;
obj.dataModel.sortDir = sotringData;
obj.dataModel.data = data_grid;
 $grid = $("div#grid").pqGrid(obj);

but doesn't work for me. Any Idea? thanks.
Title: Re: Save sortingDir and Data on roDblclick.
Post by: paramvir on January 24, 2020, 10:34:40 pm
In your code, you have incorrectly assigned direction to indx and indx to direction.

Moreover dataModel.sortIndx and dataModel.sortDir are long obsolete, please assign indx and direction to sortModel.sorter option.

Please let me know if you need further help.