Angular ui-grid filtering after data refresh - ui-grid

We are using Angular ui-grid in our project. We have a grid in our project, that uses filtering (both using drop-downs and free-form text). Once the grid is refreshed and new data is got, we could see that the filtering values are not touched. However, we want the new data to be filtered using the old filtering values. How to do it using ui-grid? Please let us know.
Thanks
Udaya

Two solutions i can think of are:
Using Single Filter:
http://ui-grid.info/docs/#!/tutorial/321_singleFilter
Manually filter the data first then pass to grid.

Related

Issue with Ag grid implementation in Angula2

It was a very big problem to me please help me, I am using ag grid to show the Data Base data for retrieving purpose it is working fine, but when i am editing the data of existing records , edited data is not binding to component.ts file. I mean if i enter any new column or modify the existing column the data is not reflecting in to the component.ts.(In Angular2 terminology it is similar to two way data binding).

Columns order in ListGrid Smartgwt

How can I programmatically change the order of columns in ListGrid? I have search for an appropriate method in javadoc but found nothing. Is it possible?
Check out setViewState method and this example that saves and restores grid preferences (including column order). So in short, you are interested in getting viewState string from ListGrid data and using it. Remember to redraw grid after setting new viewState.

Is it possible to create editable datatable using Omnifaces #{of:setToList}

I am trying to create a editable datatable whose values are java.util.Set. But in JSF-2.0 and 2.1 this is not possible as explained in Displaying objects from a Set collection in Datatable JSF does not work.
Till now as a work around all Sets are converted to java.util.List and everything works.
As mentioned in answer to var is the collection, not the item, I am trying Omnifaces #{of.setToList} so that I can avoid unnecessary conversion of Set to List. Everything works well when its a normal datatable. But when I tried to convert it to editable datatable, it doesnt work. So, is it possible to create editable datatable using Omnifaces #{of:setToList}?
Maybe I am doing something wrong. I can post code if needed. Thanks in advance.

MVC selectable GridView

I am designing a webpage using MVC. One of the pages has the following controls and functions:
Controls:
2 GridViews (gvItems, gvSelectedItems)
3 buttons (btnTransferSingle, btnTransferAll, submit)
Functions
gvItems will be populated with a set of items that contains: Name, points
gvSelectedItems will contain items that is transferred from gvItems. Hence it will also contain: Name, points
both GirdViews supports multiple selection
btnTransferSingle will transfer all selected items from gvItems to gvSelectedItems.
btnTransferAll will transfer all remaining items from gvItems to gvSelectedItems.
btnSubmit will send all the items from gvSelectedItems to the Controller.
I am not sure how to the following:
1) How to create a gridview that supports multiselection and displaying of multiple model attribute.
2) How to transfer the items from one gridview (gvItems) to another (gvSelectedItems)?
3) How to pass back all the items from gvSelectedItems to the controller?
I am able to do the stuff that was mentioned using listBox but listBox only allows displaying of only one attribute and doesn't have a header.
I used Matt Kruse Javascript's Toolbox to aid the moving of items between listboxes.
Any help is appreciated. Thanks.
I think that listboxes are the correct approach here.
If you want to display both attributes try to concatenate them when loading the data.
Headers can be somewhat added with html/css

SmartGWT LiveGrid unable to apply style to grid records programmatically

I am using SmartGWT 2.5, specifically a ListGrid backed by a RESTDataSource.
The Server integration is achieved by way of a servlet, and I only need to implement fetchData(). The data is a List<Map<String, Object>> populated on the server side, converted into JSON and sent in the DSResponse. The Live grid backed by the datasource triggers a server fetch programmatically by way of grid.fetchData().
Requirement:
I wish to set a record base style (or custom style) based on the value of one of the record's attributes, which I send over from the server.
In order to do this, I have tried a DataArrivedHandler, where I iterate over the available rows, get the ListGridRecord from the grid using the row number, and use gridRecord.set_baseStyle(String stylename) or gridRecord.setCustomStyle(String stylename) to try and apply a greyed out css for that record. After this, I call grid.markForRedraw(), however to no effect. The CSS does not get applied.
I must mention that I have used the same css to grey out rows on a normal listGrid (no dataSource) very successfully.
Questions:
Is my strategy the right one?
Is there an alternative method to apply a style to a record based on an attribute value.
Your strategy is correct and I have successfully achieved your required functionality in code of mine. Make sure you are correctly getting the record and that the test attribute is present in it. I suggest a JSON.encode(record.getJsObj()) to see what your record actually is filled with. No need for markForRedraw() explicit call, as after the DataArrivedEvent has fired the ListGrid will redraw its view. Post a small code snippet if you need more help. Also as suggested from the comment from Alain, highlights might be another good option to look at.

Resources