How to remove checkbox selection from all views in checkbox selection model in EXT grid - extjs

I have a Ext grid with checkbox selection Model. The grid contains multiple pages of 50 records each. I have a 'Clear Selections' button to deselect all the selected rows in the selection model.
The code for this is :
handler: function(){
this.selectionModel.deselectAll();
this.selectedReordsArray.clear();
},
scope: this
The problem is, when I select some records in the first page and move to second page and select some records there as well. Now if I click 'Clear Selections' button it deselects the rows on that page i.e. second page , but when I go back to page 1 , the rows there are still selected.
Is there any way to remove checkbox selections from all the pages.
Thanks,
PS : I am using Ext JS 4.1.3

Add "pruneRemoved: false" for your selmodel. Then try adding deselectAll() method for your gridstore. This will clear selected records from all pages.

Related

ExtJS 6.5 View, how to unselect last one selected

I've got an Ext.view.View that has a list of templates rendered. When I select a row on the view, I want the previous one selected to be unselected. Currently, I have an onchange event that deselects everything (see below), but that causes problems when I have items filtered.
How can I DeSelect just the currently filtered rows. below is my unselect everything code.
Ext.Array.each(this.query('dataview'), function (v) {
v !== sm.view && v.getSelectionModel().deselectAll();
});
Want I'm wanting is to just deselect the rows that are filtered in the associated store. The problem with the above code is that when it runs, the filter gets removed and all the rows in the view show back up again.

How to add Radio Button in columns while rendering Data Grid in React js

Is there any way to use radio button instead of checkboxes in react-data-grid component ?
As per my project requirement , I can only edit a single Row at a time in DataGrid.
For example : If we have columns, Employee ID and Employee Name in DataGrid, On selecting particular Row a button will be enabled which will direct to a page wherein we could edit the other details of the selected Employee. At a time, only one Row should be editable.
How can I achieve this?

extjs- checkboxgrid check boxs unselecting on clicking different column in grid

I am using checkboxmodel grid in extjs for display values.
after selecting multiple row checkboxs, if i click different column all selected checkbox are unselecting. how to stop this.
https://fiddle.sencha.com/#fiddle/18bj
Use checkOnly: true on the selection model:
True if rows can only be selected by clicking on the checkbox column,
not by clicking on the row itself. Note that this only refers to
selection via the UI, programmatic selection will still occur
regardless.
https://fiddle.sencha.com/#fiddle/18bo

Simulate a click event on a grid row

How can I dynamically click rows in my grid?
E.g.: I am using border layout.
I have a grid in the west with a list of Companies.
When I click on a Company, the information of the company which has an Id, is displayed in a form in my center area.
Now, when I want to add a company ( I am doing this with a button which opens a "Add window"), and type all information in the form and then press "save", I reload the grid.
How could I make it, that the company which is newly added, is clicked on and its information is displayed in the center area.
NOTE: The companies are listed with an ajax request, and the information is called with a "onCompanyGridHandler".
You can make the new campany created added in the top of the grid by sorting the grid's store with, for example, the date of campany creation. You can so add this line in the grid's store:
sorters: { property: 'datecreate', direction : 'DESC' },
Then, after the campany creation, you select the first row of the grid, using this code:
Ext.getCmp('your_grid_id').getView().select(0);
There are a couple of approaches you can take here:
In the function where you add the data from the Add Window to the grid panel's store, you can also get the form and use the form's loadData() method to load the data into the form, populating both the Grid and Form at the same time.
As is mentioned in a comment, after adding the data to the grid's
store, make fire the click event on the row in the grid that is
displaying the new data. I prefer the first approach because you do
not have to find the correct row in the grid and fire its click
event. In the first approach both the grid and form are loaded
with the data directly.
David

EXT.js Grid CheckboxSelectionModel: Header Check box not updating

I have an EXT js grid that uses the CheckboxSelectionModel. The grid is paged. The first column is check-boxes and this columns header is a check box as well. When the column header box is clicked, it selects/delesects all rows on the page, and only that page. The problem is that if on one page you select all, and then go to another, the column header box is still checked. the records are not selected which is correct, it's just the top one that is not updated. I found the code that fires when switching pages. I already have a selModel var set up. I found a condition to check whether or not the column header should be checked, I just don't know how to updated it. can anyone give me an idea how to do this?
Have you tried adding a listener to your grid's data store:
listeners : {
'load' : function() {
grid.getSelectionModel().clearSelections();
}
}
Hopefully the clearSelections() method will also uncheck the header checkbox.

Resources