Is it normal that when I have a grid and I select the first row, then I try to select another row it actually deselects the first row without selecting the new one? It seems like a feature to me 'cause it happens to all my grids even with the simplest settings. Is there a way to remove this option?
Yes, this is the default behavior. You can set the selection mode to multiselect, which allows you to select multiple rows by holding the CTRL or SHIFT keys.
I'm unsure which version of ExtJS you are using, but if it is version 4.2, you can set the mode of the selection model to 'SIMPLE' in order to achieve the behavior you are expecting.
Ext.create('Ext.panel.Grid', {
// other grid configs
selModel: {
mode: 'SIMPLE'
}
}
The docs for the mode config are here: http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.selection.Model-cfg-mode
It seems that this was an error with my version of ExtJS. My coworkers were using 4.2.2 while I was using 4.2.1. When I upgraded to the new version everything got fixed by itself. Weird since this does not seem to have been documented...
Related
I'm trying to provide swipe actions in Sencha Modern list in version 7.2.0.
Although the documentation indicates that the text, ui, iconcls and cls are bindable, I'm unable to get it to work.
Further, the text seems to be getting bound without any bind configuration which is even more surprising.
Please see relevant fiddle
Essentially, I would like to make the iconCls and the cls change based on the record's data.
Thanks
There is definitely an issue here. The text does not seem to be handled as a bind. If the text field exists it is used..... so I did a quick override that treats the ui field similarly. if it exists it is using it. You can do the same with the iconCls... etc.
Swipper override fiddle
I'm using ext js Ext.grid.Panel. And first row is getting selected automatically on Tab/window switch. How do I avoid that ?
EXT JS Version: 6.0.2
selType: 'checkboxmodel'
As you can see in my example, by default, the first record is not selected.
Please, create fiddle replayed your problem.
Maybe your application has additional logic for selecting first row.
Whenever an item is selcted from extjs combobox, it gets highlighted as follows
Is there any way to remove this highlighting. I searched in google with no success.
I am using ExtJs 2.3.0
First of all, you really need to consider upgrading your ExtJS version. I haven't seen this behavior by default in the newer versions.
Looking at the docs, in the config phase i don't see anythin which can help you.
The simplest thing you can do is add a select listener where you call the selectText method
comboBox.on('select', function(combo,record,index) {
// set the cursor at the start
//comboBox.selectText(0,0);
var cursorEnd =combo.getValue().length;
comboBox.selectText(cursorEnd,cursorEnd);
});
See working example with jsfiddle. It uses a newer ExtJS for illustrative purposes, however the select event and selectText method are also available in ExtJS 2.3.
I am using grouped grid containing a checkcolumn. I need to control the selection of the check boxes , that is allow or not allow selection. I use the beforecheckchange function to do that. To explain the issue consider the scenario. There are five group each containing 3 rows out of which only the last group is only expanded. If I would selected last row check column, the rowIndex that would be returned would be 2, because only 3 rows are visible. That is virtual or visible rowindex is returned how to know/get the actual row index without all the group being expanded.
My Bushiness requirement requires me know the exact row index to get the record from the store. The check column is mapped with data/record from the store that allows me to take decision to allow check on the check check box. Also one from lower group is checked then same level check box from higher need also be checked.
I am using ExtJS 5.x.x framework.
I have checked the same issue exists with tree grid.
Thanking you in advance.
I believe that this would solve your issue:
// You checkcolumn listeners
listeners: {
beforecheckchange : function(component, rowIndex, checked, eOpts) {
var row = component.getView().getRow(rowIndex),
record = component.getView().getRecord(row),
realIndex = component.getView().ownerCt.getStore().indexOf(record);
console.log(rowIndex, realIndex);
}
}
Demonstration Fiddle: https://fiddle.sencha.com/#fiddle/c3e
What version of ExtJS are you using?
There are at least two known grouping bugs in ExtJS 4.2.1, fixed in 4.2.2 (EXTJS-10027) and 4.2.3 (EXTJS-10043), respectively.
It would be easier to fix these bugs in your version of Ext (or by simply upgrading) than writing workarounds for each and every grid.
If this does not solve your issue, and you are on Ext4, consider abusing the "convert" function on the underlying model. This won't work in ExtJS5 any more, I fear, but for the time being it is a good interim solution.
I have two DataGridViews in a tab and the DataSource of the second grid is based on the row selection in first grid. The problem is I cannot get the grid to refresh after some values have been inserted or updated in the prior tabs. It works fine if I click on the row but it is not working if I select the row programmatically (i.e. first row). I have tried the following but it failed to refresh.
daProgram.ClearBeforeFill = true
daProgram.fill(dsProgram)
bsProgram.ResetBindings(true) -- binding source also tried false
dgvProgram.DataSource=bsProgram -- rebinding the control
I also tried:
dgvProgram.DataSource=nothing
and
dgvProgram.DataBindings.clear()
Nothing works :-(
I would really appreciate if anyone could help me out in this.
Are you binding your data properly?
http://www.theserverside.net/discussions/thread.tss?thread_id=31014
http://bytes.com/groups/net-c/256204-refresh-databindings-winform
I have read a few things about this, and too found ResetBindings not to work.
If you're using Table Adapters, just call the fill method (the method that auto gets added in to your Form Load event).
I've read things that say you shouldn't call Fill. I see no reason why not. It simply re-queries the data, which is exactly what a refresh should do.
Me.YourTableAdapter.Fill(Me.YourDataSet.YourDataTable)
Try This
dgvProgram.DataSource=null;