Hi,
I am using igGrid in non mvc project.
I want to use Sorting, Grouping of type 'remote' with datasourceURL specified
var pageUrl = $get('serverURL').value + 'Core/UserControls/GridService.svc/GridOperations?obj='+params;
features: [ { name: "Sorting", type: "remote", sortUrlKey: "Sort",}]
Now the problem is sotURlkey thing is not working for me, When the made to server i cant identify the column and the direction.
Could any one help me, I'm Stuck here.
By default, sorting/paging/filtering/ etc params are encoded using OData. when you change the sortUrlKey and other similar properties, you are making it custom, so it's no longer "OData". On the server, in order to get the values for those keys, you need to use your server framework's API in order to get the request params. Or, if you are exposing it as a web service, they can be mapped to service method parameters.
here is a tutorial about that:
http://msdn.microsoft.com/en-us/library/cc668788.aspx
Thanks,
Angel
Hi Angel,
I tried after removing sortUrlKey and other similar properties,
The URL its posting is attached with "&pk=ID&_=1367225397270", how can i identify the Column key and Sort Order ?
and i still have similar problem with group by feature.
i'm unable to apply Sorting and Grouping on first column (Sorting and Grouping are enabled on the column), after moving the column 2 times i'm able apply sorting feature by clicking on the Column header.
Code : ---
grdUI.igGrid({ columns: JSON.parse($get('<%= hdnigGridColumnSettings.ClientID %>').value), autoGenerateColumns: true, dataSource: [], dataSourceUrl: pageUrl, dataSourceType: "json", fixedHeaders: true, // loadOnDemand: true, // responseDataKey: 'd', // responseDataType: "string", primaryKey: "ID", //enableUTCDates: true, width: "810px", // enableHoverStyles: false, renderCheckboxes: true, headerCellRendered: function (evt, ui) { // ui.owner; // ui.columnKey; // ui.th; igGrid_HeaderCellRendered(evt, ui); }, features: [ { name: "Sorting", type: "remote", //sortUrlKey: "metadata", //sortUrlKeyAscValue: "asc", //sortUrlKeyDescValue: "desc", applySortedColumnCss: false, // customSortFunction: igGridColumnSorting, columnSettings: JSON.parse($get('<%= hdnigGridSortingColumns.ClientID %>').value)//, // columnSorting: function (e, ui) { igGrid_ColumnSorting(e, ui); } }, { name: "RowSelectors", enableCheckBoxes: true, enableRowNumbering: false, requireSelection: true, showCheckBoxesOnFocus: false, checkBoxStateChanged: function (evt, ui) { if (ui.isHeader == true) igGrid_RowSelectorHeaderCheckedChanged(evt, ui); else igGrid_RowSelectorCheckedChanged(evt, ui); } }, { name: "ColumnMoving", movingDialogHeight: "300px", movingDialogWidth: "400px" }, { name: "Selection", multipleSelection: true, mouseDragSelect: false, rowSelectionChanged: function (evt, ui) { igGrid_RowSelectorCheckedChanged(evt, ui, true); }, mode: "row" }, // { // name: "ColumnFixing", // columnSettings: JSON.parse($get('<%= hdnigGridColumnFixing.ClientID %>').value), // fixingDirection: "left", // showFixButtons: false // }, { name: "Hiding", columnSettings: JSON.parse($get('<%= hdnigGridHiddenColumns.ClientID %>').value), columnChooserHeight: 350 }, { name: "Resizing", deferredResizing: false, allowDoubleClickToResize: true }, { name: "GroupBy", type: "local", groupByAreaVisibility: "top", initialExpand: true, modalDialogHeight: 350, labelDragHelperOpacity: 1, columnSettings: JSON.parse($get('<%= hdnigGridGroupingSettings.ClientID %>').value), modalDialogButtonApplyClick: function (evt, ui) { igGroupBy_modalDialogButtonApplyClick(evt, ui); } } ] });