jQWidgets Forums
jQuery UI Widgets › Forums › Grid › jqxgrid rowselect/rowunselect Help
Tagged: grid, javascript grid, jquery grid, jqwidgets grid
This topic contains 4 replies, has 3 voices, and was last updated by admin 8 years, 5 months ago.
-
Author
-
Hi I wanted help on this jqxgrid rowselect where suppose let me do a illustration
Rowselection:
Grid (Customer)
Columns: id Store Location
1 Pizzastore USA –> Row fetchedGrid (Orders) ——> rowselect event from this grid
Columns: id Item Price
1 Bread $2.00 –> Selected
1.1 Oil $3.50 –> Selected
1.2 Sauce $4.20OR:
Grid (Customer)
Columns: id Store Location
1 Pizzastore USA –> Row fetchedGrid (Orders) ——> rowselect event from this grid
Columns: id Item Price
1 Bread $2.00 –> Selected
1.1 Oil $3.50
1.2 Sauce $4.20On rowselect from the Orders grid, If I selected rows 1 with item (Bread) and 1.1 with item (Oil). I want the Customer grid to update source and show that row with value Pizzastore. But I only want it to show one row. So for instance I just selected row 1 with item (Bread), then it will update the source of the Customer grid and show that row about Pizzastore. Now what if I selected again, while that old selection is still there, and selected row 1.1 with item (Oil). This time it should still just update but have only one row with Pizzastore. (No duplicates)
Row unselect:
Grid (Customer)
Columns: id Store Location
1 Pizzastore USA –> Row fetchedGrid (Orders) ——> rowunselect event from this grid
Columns: id Item Price
1 Bread $2.00 –> unSelected(If clicked)
1.1 Oil $3.50 –> Selected
1.2 Sauce $4.20Also:
Row unselect:
Grid (Customer)
Columns: id Store Location
Empty RowGrid (Orders) ——> rowunselect event from this grid
Columns: id Item Price
1 Bread $2.00 –> unSelected
1.1 Oil $3.50 –> unSelected
1.2 Sauce $4.20On rowunselect until both rows 1 with item (Bread) and 1.1 with item (Oil) are unselected then only update the source and show empty. So if there is any other selection then keep it.
Need help
Hi dan123,
When you select a row, build a new instance of jqxDataAdapter and set the Grid’s source to point to it. If your data is local, it will be easy for you to filter what data goes into your dataAdapter. That is how master-details usually work. In your code, I think the records array is built incorrectly. On each rowselect, records should be initialized i.e records = new Array();
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Can you show a jsfiddle with an idea of my illustration i did. I wanna know
Hi dan123,
Just use a fresh instance of your “records” variable every time, instead of just filling it with new data.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.