jQWidgets Forums
jQuery UI Widgets › Forums › Grid › How to get filtering url with data?
Tagged: angular grid, beforeSend, data, filter, filtering, getfilterinformation, grid, jquery grid, jqxgrid, server, url
This topic contains 6 replies, has 3 voices, and was last updated by Dimitar 7 years, 7 months ago.
-
Author
-
How to get filtering url with data?
Hello Huseyn,
Please clarify your requirement. Where in your code do you wish to get the URL? Do you mean getting the filtering settings and processing them on the server side? If so, we have a server-side filtering help topic you can find here: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/phpintegration/php-server-side-grid-filtering.htm.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/i want to alert url with filtering, sorting and paging parameteres when this events happen,
var url=’employeesfiltering.jsp’;
var source = {
datatype: “json”,
datafields: [{
name: ‘e_id’,
type: ‘int’
}, {
name: ‘e_name’,
type: ‘string’
}, {
name: ‘e_surname’,
type: ‘string’
}, {
name: ‘e_birth’,
type: ‘date’
}],
cache: false,
url: url,
filter: function() {
$(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘filter’);
},
sort: function() {
$(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘sort’);
},
beforeprocessing: function(data) {
if (data !== null && data.length > 0) {
source.totalrecords = data[0].totalRecords;
}
}};
var dataadapter = new $.jqx.dataAdapter(source, {downloadComplete: function(data, status, xhr) {
if (!source.totalRecords) {
source.totalRecords = data.length;
}
},
loadError: function(xhr, status, error) {
throw new Error(error);
}
});
// initialize jqxGrid
$(“#jqxgrid”).jqxGrid({
width: 550,
source: dataadapter,
filterable: true,
showfilterrow: true,
sortable: true,
autoheight: true,
pageable: true,
pagesize: 5,
pagesizeoptions: [‘3’, ‘5’, ‘7’],
virtualmode: true,
rendergridrows: function(obj) {
return obj.data;
},
columns: [{
text: ‘e_id’,
datafield: ‘e_id’}, {
text: ‘e_name’,
datafield: ‘e_name’
}, {
text: ‘e_surname’,
datafield: ‘e_surname’
}, {
text: ‘e_birth’,
datafield: ‘e_birth’,
cellsformat: ‘dd.MM.yyyy’,
align: ‘right’,
cellsalign: ‘right’ ,
filtertype: ‘range’
}]
});});
Wants like this:
employeesfiltering.jsp?e_nameoperator=and&filtervalue0=a&filtercondition0=CONTAINS&filteroperator0=1&filterdatafield0=e_name&e_surnameoperator=and&filtervalue1=a&filtercondition1=CONTAINS&filteroperator1=1&filterdatafield1=e_surname&e_idoperator=and&filtervalue2=1&filtercondition2=EQUAL&filteroperator2=1&filterdatafield2=e_id&filterscount=3&groupscount=0&sortdatafield=e_surname&sortorder=asc&pagenum=0&pagesize=5&recordstartindex=0&recordendindex=5&_=1457527867609Hi Huseyn,
You can get this information in the data adapter beforeSend callback function as follows:
var dataadapter = new $.jqx.dataAdapter(source, { downloadComplete: function(data, status, xhr) { if (!source.totalRecords) { source.totalRecords = data.length; } }, loadError: function(xhr, status, error) { throw new Error(error); }, beforeSend(jqXHR, settings) { alert(settings.url); } });
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/How can I get the same information when the filter is not remote?
Hello cstff,
The method getfilterinformation returns information about the applied filters. You can read more about it in the jqxGrid API documentation.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.