How to dynamically update summary type for grid in extjs4.1 - extjs

How to dynamically update summary feature for grid in extjs4.1?
In my application the grid summary will become filled at the time of loading the page, the grid by calculating a total using the summary feature. I have a combo box drop down in the screen. If a user selects from the combo box, I need to update the grid records from store and also need to update the calculated summary value using records coming from another store.
Can anybody tell me how to do that? Thanks

Assuming that yourGridItemId is the first/only grid with this itemId, the following code should work:
Ext.ComponentQuery.query('#yourGridItemId')[0].getView().refresh();

Related

Filtering data from the extjs grid on the display values

Currently, I'm able to filter the grid using the code
new Ext.ux.grid.GridFilters({local: true,filters:[columns]}) as plugin. But this filters the store. And as the grid contains combo cells it maintains the stored value in store and displays it via the combo renderer.
I just want to know how can this be achieved so that the filter happens on the display values of the combo and not from the store Or can it be modified to filter from grid view?
Thanks in advance

Filters are not getting reset after loading new data to grid based on selected date

I'm using the date field as a selection criteria for populating the grid.
I want to reset the previously applied filters once the new data is about to be loaded in grid.
However, the filters are not getting removed and the menu icon for filter is showing additional values under select boxes which is very confusing in case the grid has less number of rows. I'm using this in my angularjs website.
Please assist me in getting this resolved.
I've already opened the issue in github also. Below is the link:
https://github.com/ceolter/ag-grid/issues/606

Limit data based on UniqueCount

I have charts on a tab, that should only show if 1 value from a column filter is selected.
For example if a field named: BUSINESS_UNIT has values of "HR","FIN","IT" The charts should only show data if 1 value is filtered on. Such as "HR."
These charts do not contain the BUSINESS_UNIT field itself.
I tried using the Limit Data Using expression, but for some reason the limit expression UniqueCount(BUSINESS_UNIT)=1 doesn't work.
How would I hide the data in the charts, unless 1 BUSINESS_UNIT is selected?
What you could do is hide the filters panel and create radio buttons on a new text area for each property to mark data. If you need help setting this up let me know. Then in your visualisations limit data using markings and show an empty visualisation if no items are marked.
One downside to this is maintenance, if the values change you will have to update the UI.
Another possible solution (untested) is to change the filter panel properties from checkboxes to radio buttons.
Filter Panel Properties:
http://stn.spotfire.com/spotfire_client_help/filter/filter_panel_properties.htm
You want it to look something like this:
http://stn.spotfire.com/spotfire_client_help/filter/filter_radio_buttons.htm

How to update a Ext JS 4 grid when popup form is submitted

Please point me to an Ext JS 4 code sample of a grid with records editable via a popup form. It seems to be a common use case, but I can only find editable grids with editing in place.
My approach:
Each row in the grid has an Edit button, which shows Ext.window.Window with an item Ext.form.Panel.
When the form is submitted I have all the fields, which correspond to a record in the grid store.
I get record using:
var storeRecord = grid.getStore().getAt(index);
But when I modify properties of this record, and hide the form window, the grid does not show updated values.
Am I missing some step? Do I need to force refresh? Or maybe there is a standard way to configure the grid with an editor as a form panel?
After two days of searches, trials and errors, I found the solution:
grid.getView().refresh();
I wish there was a faster way for Ext learning curve. :(

ExtJS 4 - How to avoid grid column value becoming null when column editor is combo-box?

I have a column in a grid with editor as combo-box.
When the grid is loaded then all the column values get displayed properly.
The issue is, when user clicks at the column (having combobox as editor) to edit it then the column value becomes null as shown in the attached screenshot.
I understand that the value becomes null as the store of combobox has not been loaded yet.
I can not use autoLoad true due to the heavy amount of data present in the combobox store. Moreover, even if I use autoLoad:true for the store with paging in it, then that too safeguards only those values which are present in the first page and not all.
Thus, how can I maintain the value in grid column when that value is not present in the store of combobox used as editor for the column?
Could anyone guide at this?
PS: I am using ExtJS Ver 4.0.2a
I have been able to find a solution for this.
It has more to do with the version of ExtJs. If we upgrade to 4.0.7 and then use forceSelection:false for a combobox then things work fine as expected. That is, the combo-box accepts a value which doesn't exist in its store and doesn't set the current value to null.
Hope this helps someone else too looking for something similar.
I would suggest having the grid record contain both that columns value, as well as display value. If the combo store lookup is unable to find a matching value (because that combo store hasn't been loaded yet), then revert to showing the display value stored with the grid record.
You might also need to have the afteredit event on the grid update that grid records display value after that column is edited for a particular row.

Resources