how to persist filter in ag-grid vuejs - ag-grid

How to persist the filter in ag-grid vuejs . I'm trying to apply filter but when I click on a row for looking the data inside the row node the filter selection is removed I meant the grid load from the starting (reset filter). how to persist this filter.
second problem and I'm facing one more problem is that the selection of row is not working in a long time ... I have applied checkbox in the header but when I select the checkbox after a couple of seconds it will automatically deselect ..so my second question is how to apply checkbox the will not deselect automatically. one particular node check box is not working also
thanks in advance I'm new in this technology please help me out from core ...

I guess for the first problem of yours you should set newRowsAction to 'keep' like this.
{field: 'year', filter: 'number', filterParams: {newRowsAction: 'keep'}}
This property is for when using the Client Side Row Model only. When set to 'clear', updating the data in the grid by calling api.setRowData() (or updating the rowData property if bound by a framework) will clear (reset) the filter. If you instead set this to 'keep', the grid will keep its currently set filter when the data is updated.
Default: 'clear'
for the second problem of your its really hard to interpret based on words so it will be good if you can create minimum code working demo(reproducing the error) on plunkr or stackblitz so that we can help you.

Related

Ag-Grid Set Filter update list of available values after initialisation

I am using Ag-Grid Enterprise and have applied a set filter to a column, so far so good. I am using Server side row model and am pivoting data successfully on the backend (C# ASP.Net Core).
Once a user applies a filter to one column, I want the other column filters to be updated with a new list of available values that has been limited based upon the column filters that are set.
For example:
Colours:
Black
Orange
Red
Yellow
Blue
In Rainbow:
True
False
Now the idea is that when I set In Rainbow filter to True, I will update the Colours list to exclude black, the logic behind that is done on the C# side and thats fine, basically I fire a query to the server that will include In Rainbow = true, and it will return me an array of the colours that match this particular query.
So I can get the array of colours in javascript back and grab the filter successfully, i.e.
var data = ["Orange", "Red", "Yellow", "Blue"];
var filter = gridOptions.api.getFilterInstance(columnName);
However I cannot find a way to tell ag-grid that I have new values that I want to make available in the set list.
I have tried:
filter.setFilterValues(data);
and
filter.setModel({
type: 'set',
values: data
});
But neither appear to make changes to the set filter values that are available to select.
Any help on this would be greatly appreciated
i'm not sure i completely understand your question but as far as i understand you want to set the values in you filter dynamically or something along these lines and if that's what you want i would suggest that you use filterParams. filterPramas has an attribute for value so it would go like this filterParams:{values:getvalues} get values will bet the function that will return the values you want there is the link to the filterParameters in ag-grid docs https://www.ag-grid.com/javascript-grid-filtering/#filter-parameters

Updating slickgrid autocomplete fields without rerendering the grid

I'm using SlickGrid in a sharepoint environment to display and update data. To save on the the load time, I am populating auto complete fields with options that have only been used in previous lines (with tables with more than 50 lines), and then I am wanting to give the user the option to click on a "Metadata refresh button" located at the top of the autocomplete fields that will go and fetch all available options to repopulate the auto complete field.
<table><tr><td>[ TextField ] </td><td>[ AutoComplete1 ] </td><td>[ AutoComplete2]</td></tr>
<tr><td>Entry1</td><td>Hello</td><td>Goodbye</td></tr>
<tr><td>Entry2</td><td>Hi</td><td>Later</td></tr>
</table>
So if, the user was to create a new line, they would have the options of Hello and Hi in column 2, and Goodbye or Later in column 3 to choose from since they have been used before. If they want the option "Hail!" to appear in column 2, they would have to click the "Update MetaData" button for column 2, which would refresh ALL the cells in that column with all available but previously unused selections.
I know its not ideal, but its a requirement that has been given to me.
I know how to add buttons to column headers and I am updating the array of data that the grid needs for the autocomplete column, but I am at a loss on how to update the column choices without redrawing the whole grid.
Any suggestions?
Check out the newer examples in my repo: https://github.com/6pac/SlickGrid/wiki/Examples
This is probably closest to what you want:
http://6pac.github.io/SlickGrid/examples/example-autocomplete-editor.html
What I have done in the past is create a data property of the cell node to store the object, like:
$jqacContainer.data('queryautocomplete', jqac);
It's then easy enough to get the object from the cell node.
However, this requires proper cleanup of the property to avoid a memory leak. This should be able to be done in editor.destroy(), but I don't think I've checked corner cases, for example where the editor is scrolled offscreen before being completed.

What ExtJS 4.2 standard function gets executed for grid selection when using Ext.selection.RowModel (default) selModel?

There is a bug with the way the Ext.grid.Panel rowexpander plugin works when a nested grid is set to renderTo to the rowexpander div id.
When this is implemented, it's difficult to see what is actually being selected. The reason for this is because the config "disableSelection" and "trackMouseOver" are to be both considered for highlighting. I have to set "trackMouseOver: false" so that hovering over grid rows doesn't interfere with reproducing this behavior. Then "disableSelection: false" must be set so that this selection issue does actually occur.
The issue is that when you select index 1 of the nested grid of parent grid index 0 row, index 1 row of parent grid is selected as well. If you select index 2 of the nested grid of parent grid index 0 row, index 2 of parent grid is selected as well.
When 935424 is selected, 815138 is selected since they are both index 0.
When 1056257 is selected, 1013525 is selected since they are both index 1.
When 1200191 is selected, 1261631 is selected since they are both index 2.
I'm suspecting that the selection model instance might be getting shared with the grid and nested grids since I'm using the same definition. They are of course different instances of the same definition, but I'm not sure how the framework handles additional grids using Ext.create?
I'd like to ask how to fix it or get me close, I'll be up-voting you (often). But if you can at least give me a clue as to where this selection function is being called in the framework, that will get me on the right track and can debug and discover a fix for it. I've read that events can bubble, and maybe that's what's happening here. It seems to have a handle on the row as well, because when I double click the nested grid row, it not only tries to expand that row, but also the row from the parent grid row (that matches the row index).
After any recursive nested grid is created, I had to call this line so the click and dblclick (and others) events don't bubble/propagate to the parent grid.
grid[cnt].getEl().swallowEvent(['mouseover', 'mousedown', 'click', 'dblclick', 'onRowFocus']);
How did you load the selection model ?
selModel: 'rowselection',
Or
selModel: Ext.create('Ext.selection.RowModel'),
If you use the first syntax, you should get an independent selection model for each grid. If you use the second syntax, you get only one selection model that is shared among all grid instances.

How to remove the sort indicator in GtkTreeViewColumn keeping the column sortable?

I know it's a bug that is considered not an issue but when you have many columns that you still want them sortable, all displayed without the need to scroll right and left and the sort arrow indicator is not so important. What are available workarounds?
I found it can be done by not applying set_sort_column_id to the treeview column. We must do it programatically through using set_clickable method to the the column that you don't want an arrow to be displayed in its header, then using signal_connect to the clicked signal and bind it to a function which will use get_sort_column_id of the model to get the current sort order whether GTK_SORT_ASCENDING or GTK_SORT_DESCENDING then apply the reverse sort order using set_sort_column_id on the model.

SqlDataSource filter on conditional dropdownlist values

i have 3 dropdownlists that i need to filter my datasource at runtime.
Each of the dropdownlists must be combined with the other two BUT they also have a 'special' value of "ALL". in this case i want to disable filtering on the specific filed and show all values.
Does this come with some out of the box functionality from asp.net or i have to build the string every time ?
After searching in many places i finally found out that there is NOT an out of the box functionality of asp.net to dynamically build WHERE clauses based on the values of every control that i want to participate in filtering.
I ended up with custom coding on the gridview selectedindexchanged event that builds the selectcommand text and binds the gridview again.
works fine!