jQWidgets Forums
jQuery UI Widgets › Forums › Grid › filter does not work when aggregates
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 10 years, 8 months ago.
-
Author
-
Hi,
I have a jqxGrid with aggregates as true and filterable enabled. but filter does not work. any issues in the objects?Hi Adarsha,
We cannot reproduce such behavior. Please, share a sample preferably in jsfiddle.net. Working example: http://jsfiddle.net/jqwidgets/wnvg9m77/
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/thx peter,
i wonder wht is the mistake in my code.. the fiddle is not opening for me today since my netwrok is very slow. i can only paste my code below.
Can u pls help, as i have a presentation tomorw to the customer, and if this fly then there will be a commericial licence with your team. we liked your widgets.I have beloow issues.
1. the aggregates are not displayed
2. when i horizontally scroll the pinned column filter textbox disolve insde
3. the filter does not work$(document).ready(function (){
// ******** Create anaGrid ********* //
json = ‘[{“columns”:[{“text”:”Fa”,”datafield”:”fa”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”Mkt”,”datafield”:”mkt”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”Typ”,”datafield”:”typ”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”En”,”datafield”:”en”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”Sv”,”datafield”:”sv”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”BGS”,”datafield”:”bgs”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”MC”,”datafield”:”mc”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”Color”,”datafield”:”color”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”Uphols”,”datafield”:”uphols”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”Option”,”datafield”:”option”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”Smess”,”datafield”:”smess”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”OT”,”datafield”:”ot”,”pinned”:”true”,”filtertype”:”textbox”,”filtercondition”:”starts_with”,”width”:”60″,”align”:”center”},{“text”:”2014W25″,”datafield”:”weeks1″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W26″,”datafield”:”weeks2″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W27″,”datafield”:”weeks3″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W28″,”datafield”:”weeks4″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W29″,”datafield”:”weeks5″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W30″,”datafield”:”weeks6″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W31″,”datafield”:”weeks7″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W32″,”datafield”:”weeks8″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W33″,”datafield”:”weeks9″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W34″,”datafield”:”weeks10″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W35″,”datafield”:”weeks11″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W36″,”datafield”:”weeks12″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W37″,”datafield”:”weeks13″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W38″,”datafield”:”weeks14″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W39″,”datafield”:”weeks15″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W40″,”datafield”:”weeks16″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W41″,”datafield”:”weeks17″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W42″,”datafield”:”weeks18″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W43″,”datafield”:”weeks19″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W44″,”datafield”:”weeks20″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W45″,”datafield”:”weeks21″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W46″,”datafield”:”weeks22″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W47″,”datafield”:”weeks23″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W48″,”datafield”:”weeks24″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W49″,”datafield”:”weeks25″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W50″,”datafield”:”weeks26″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W51″,”datafield”:”weeks27″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2014W52″,”datafield”:”weeks28″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”},{“text”:”2015W01″,”datafield”:”weeks29″,”width”:”70″,”align”:”center”,”aggregates”:”[‘+ “‘”+’sum’+”‘”+’]”}]},{“rows” : [{“id”:”1″,”fa”:”22″,”mkt”:”110″,”typ”:”134″,”en”:”07″,”sv”:”12″,”bgs”:”0B1″,”mc”:”10″,”color”:”702″,”uphols”:”3661″,”option”:”000255″,”smess”:”00000″,”ot”:”00″,”weeks1″:”0″,”weeks2″:”0″,”weeks3″:”0″,”weeks4″:”0″,”weeks5″:”0″,”weeks6″:”0″,”weeks7″:”0″,”weeks8″:”0″,”weeks9″:”0″,”weeks10″:”0″,”weeks11″:”0″,”weeks12″:”0″,”weeks13″:”0″,”weeks14″:”0″,”weeks15″:”0″,”weeks16″:”0″,”weeks17″:”0″,”weeks18″:”0″,”weeks19″:”0″,”weeks20″:”0″,”weeks21″:”0″,”weeks22″:”0″,”weeks23″:”1″,”weeks24″:”0″,”weeks25″:”0″,”weeks26″:”0″,”weeks27″:”0″,”weeks28″:”0″,”weeks29″:”0″}]},{“datflds” : [{“name”:”fa”,”type”:”string”},{“name”:”mkt”,”type”:”string”},{“name”:”typ”,”type”:”string”},{“name”:”en”,”type”:”string”},{“name”:”sv”,”type”:”string”},{“name”:”bgs”,”type”:”string”},{“name”:”mc”,”type”:”string”},{“name”:”color”,”type”:”string”},{“name”:”uphols”,”type”:”string”},{“name”:”option”,”type”:”string”},{“name”:”smess”,”type”:”string”},{“name”:”ot”,”type”:”string”},{“name”:”weeks1″,”type”:”string”},{“name”:”weeks2″,”type”:”string”},{“name”:”weeks3″,”type”:”string”},{“name”:”weeks4″,”type”:”string”},{“name”:”weeks5″,”type”:”string”},{“name”:”weeks6″,”type”:”string”},{“name”:”weeks7″,”type”:”string”},{“name”:”weeks8″,”type”:”string”},{“name”:”weeks9″,”type”:”string”},{“name”:”weeks10″,”type”:”string”},{“name”:”weeks11″,”type”:”string”},{“name”:”weeks12″,”type”:”string”},{“name”:”weeks13″,”type”:”string”},{“name”:”weeks14″,”type”:”string”},{“name”:”weeks15″,”type”:”string”},{“name”:”weeks16″,”type”:”string”},{“name”:”weeks17″,”type”:”string”},{“name”:”weeks18″,”type”:”string”},{“name”:”weeks19″,”type”:”string”},{“name”:”weeks20″,”type”:”string”},{“name”:”weeks21″,”type”:”string”},{“name”:”weeks22″,”type”:”string”},{“name”:”weeks23″,”type”:”string”},{“name”:”weeks24″,”type”:”string”},{“name”:”weeks25″,”type”:”string”},{“name”:”weeks26″,”type”:”string”},{“name”:”weeks27″,”type”:”string”},{“name”:”weeks28″,”type”:”string”},{“name”:”weeks29″,”type”:”string”}]},{“listsource”:[{“label”:”Fa”,”value”:”fa”,”checked”:”true”},{“label”:”Mkt”,”value”:”mkt”,”checked”:”true”},{“label”:”Typ”,”value”:”typ”,”checked”:”true”},{“label”:”En”,”value”:”en”,”checked”:”true”},{“label”:”Sv”,”value”:”sv”,”checked”:”true”},{“label”:”BGS”,”value”:”bgs”,”checked”:”true”},{“label”:”MC”,”value”:”mc”,”checked”:”true”},{“label”:”Color”,”value”:”color”,”checked”:”true”},{“label”:”Uphols”,”value”:”uphols”,”checked”:”true”},{“label”:”Option”,”value”:”option”,”checked”:”true”},{“label”:”Smess”,”value”:”smess”,”checked”:”true”},{“label”:”OT”,”value”:”ot”,”checked”:”true”}]}]’;
var obj = jQuery.parseJSON(json);
var columns = obj[0].columns;var rows = obj[1].rows;
var datfld = obj[2].datflds;
var listsource = obj[3].listsourcevar source =
{
totalrecords: 100,
datatype: “json”,
localdata: {}
};var getdata = function (startindex, endindex) {
var data = {};
for (var i = startindex; i < endindex; i++) {
data[i] = rows[i];
}
return data;
}var rendergridrows = function (params) {
var data = getdata(params.startindex, params.endindex);
return data;
}
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#anaGrid”).jqxGrid({
width: ‘90%’,
height: 600,
source: dataAdapter,
filterable: true,
showfilterrow:true,
virtualmode: true,
rendergridrows: rendergridrows,
showstatusbar: true,
statusbarheight: 50,
showaggregates:true,
columns:columns
});
});Hi Adarsha,
You have the below code:
virtualmode: true,
rendergridrows: rendergridrows,In virtual mode, the Filtering, Aggregates, Sorting, Paging, etc should be implemented with custom code by you – See the Server Paging and Server Filtering demos in the PHP Integration section.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.