jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Issue with interactive Tables
Tagged: filter, getdisplayrows, grid, jqxgrid, master-details, value
This topic contains 8 replies, has 2 voices, and was last updated by Glen 11 years, 8 months ago.
-
Author
-
I have an issue with implimenting below functionality.
I have two tables developed using JQwidgets
1. When I select a value from first table(Say Employee ID)
2.All the values corresponding to that field(in our example -employee ID) , should be filtered out in the second table.I’m stuck up with this issue.Any tips in resolving this issue will be appreciated.
Thanks in advance.
Hello Toms,
Please check out the demo Master-Details. We hope it is helpful to you.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Thanks a ton Dimitar . I was really stuck up with this issue. I could able to perform this functionality now.
Is’t possible to do below functionality using jqwidgets ?.
In the example you have provided.When i click on a row , corresponding related records will be shown in second table.
Now my implimentation is..If i filter out some record in first table , corresponding related records should be showed in second table.Any pointers or clue on implimenting this functionality
To get the column name of filtered record , we can use the below code
var filterinfo = $(“#jqxgrid”).jqxGrid(‘getfilterinformation’);
var eventData = “Triggered ‘filter’ event”;for (i = 0; i < filterinfo.length; i++) {
var eventData = "Filter Column: " + filterinfo[i].filtercolumntext;
alert(eventData)}
But how to get filtered out values in an array.
for eg : I have following values in an array {a,a,y,a,a,k,s}.
I have filtered out all the ‘a’ s . How to get these filtered out values(in this case {a,a,a,a}) in an array ( var data=new Array();)Thamks in advace
Hi Toms,
Here is how to get the filter values:
var filterinfo = $("#jqxgrid").jqxGrid("getfilterinformation");var filters = filterinfo[0].filter.getfilters();
The filters variable is an array of objects. Each object contains the properties value, condition, operator and type.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Thanks for the response Dimitar .
But my issue is how to get the filetred out values in an array .
Using var filters = filterinfo[0].filter.getfilters(); , we can get value, condition, operator and type.
But what i need is filtred out values. eg if localdata: {a,a,a,b,c,a} has following values and I have filtered the data using the criteria
filter= a . So my grid\table will sho up all the filtered values (in our example {a,a,a,a}).
So how to get this values in an array.
For rowselect( $(“#jqxgrid”).on(‘rowselect’, function (event) {) ,
, we can get the values like
var cis = event.args.row. . Similarly After filtering out the grids , I need to retieved the filtered values like this in an array({a,a,a,a})).
I’m really stuck up with issue.Any help will be appreciated
The real issue is , when I apply filter in first table…values corresponding to filtered out row should be shown in second table .
Master-Details example was helpful in doing the same functionality while a row is selected.
But my issue is I have to implement the same functionality when a column is filtered out.
Hi Toms,
Please use the method getdisplayrows. Here is more information about it from the API Documentation:
Gets all rows that are currently displayed in the Grid. The method returns an Array of the displayed rows. The Grid’s sorting, filtering, grouping and paging will affect the result of this method.
Code example
Invoke the getdisplayrows method.
// gets all rows loaded from the data source.
var rows = $(‘#jqxGrid’).jqxGrid(‘getdisplayrows’);
// gets the first displayed row.
var rowData = rows[0];
// gets the ID of the first displayed row.
var rowID = rowData.uid;
// gets the bound index of the first displayed row. The bound index is the row’s index in the array returned by the “getboundrows” method.
var boundIndex = rowdData.boundindex;Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Wow .This is what exactly I was looking for.I tested and it works perfectly
Dimitar , thanks a ton buddy :).
-
AuthorPosts
You must be logged in to reply to this topic.