Sencha touch grid Summaryrow values disappering - extjs

I am using Sencha touch grid and I am facing one issue in the development.
The issue is, if I reorder the columns of the grid using ViewOption plugin, the SummaryRow values get disappered. How do I retain the summary row values after Column reordering?
I am using Sencha touch 2.3.x
Thanks in advance!

I was reading the sources and I don't think Grid is finished.
What I found is the ViewOptions.onColumnReorder apparently only change the DOM elements order and not the store order. And reading the SummaryRow.updateGrid I didn't find any bind with both. SummaryRow only bind with store and add/remove/etc columns (not reorder).
I can be wrong, I didnt try grid yet. But I guess your best shot is try to force the SummaryRow.doUpdateSummary after the onColumnReorder.

Related

how to show multiple fields in a single column editor in extjs grid

We are building an application which is using the grid to show records. Now we cam across with a requirement to show 2 fields(1combo and 1 textfield) in a single cell editor. we have tried with 2columns with 2editors but the problem here is we need to enable the both cell editors at the same time.
this link http://blog.platinastudio.com/?attachment_id=2485 can be helpful for understanding the requirement clearly.
any help will be greatly appreciated!!
Thanks
Sanjeeva
If you are able to use two columns and 2 editors, then you should just need to do the wiring manually, and it should work okay.
For each editor, listen for the beforeedit event
In the handler, call startEdit on the other editor
You'll need to configure the editors to not reset on blur probably, and there may be additional configuration needed to get the interactions right, but in theory it should work out.
If you are trying to use two editors in the same cell, then you can mention xtype:'container' in the editor configuration of the column and add your fields in this container.
An example of this is given here

ExtJs - getRow by index of Gridpanel

Im using Extjs 4.1 with a gridpanel. Now I want to get a row by id/index to just hide it (not filter).
I tried that (it says there is no method getRow):
gridpanel.getView().getRow( 0 );
What is the correct way now?
I know gridview has getRow, so why cant I use it?
Edit: there seems to be no such method in 4.
Since ExtJS 4.1.3 no longer returns a GridView you have to work around this.
Take a look at:
Sencha Forum --> Getting gridview row element
In my opinion its a ugly solution, but it's not getting alot of attention..

Trouble with refreshing Data Grid View

I've been having a lot of trouble displaying all the records I have in a Data Grid View Control. I'm using unbound data to populate my grid since there are not many records to display and I need that data to be read only. My issue is that when I populate my grid programatically, not all rows are displayed and they're only displayed when I try resizing the header column width. I tried different things like Refresh, Invalidate, etc to make the grid display all records but nothing worked! I would really appreciate any insight on why this happens and how to solve it!
Thanks
you can try to display your records with other controls
look at my answer for this question
Gridview with expandible rows for winforms
can you post some code to reproduce teh problem?
best regards

Ext.net grouping grid

I'm building an application that displays some results in a grid, using the Ext.NET controls.
The grid is created dynamically, in the C# code-behind. I would like to let the user see the results in a grouped grid, grouped on the first column in the grid.
I want to do this dynamically, from C#, by changing the existing grid.
How should I proceed, what properties should I use?
You need to use GroupingStore To dynamically change grouping, you need to use this store's groupBy and clearGrouping methods.
Here is good example from sencha -
Grouping.html (js source code - grouping.js)
Maybe the following Grouping example can help get you started, see
http://examples.ext.net/#/GridPanel/Miscellaneous/Grouping/

Scroll to selection in an ExtJS Grid

Hey, i need to be able to scroll my ExtJS grid to the current selection but have no idea how to do this. I came across a reference in a forum to an ensureVisible method but can find no information. Can anyone make any suggestions?
Thanks
This also seems to work:
grid.getView().focusRow(rowIdx);
Unfortunately ensureVisible() was removed from ExtJS 4. The most straight-forward solution I found is to use scrollIntoView(). In my case, this was after selecting the row based on a value I loaded.
var rowIndex = store.find('fieldName', value);
grid.getSelectionModel().select(rowIndex);
Ext.fly(grid.getView().getNode(rowIndex)).scrollIntoView();
This will show the selected row at the bottom of the grid. More work would need to be done to have it at the top or middle of the grid.
This also seems to work:
grid.getView().getRow(rowIdx).scrollIntoView();
Worked for me on ExtJS 6, even with bufferedRenderer turned on.
var record = grid.getSelectionModel().selected.getRange()[0];
grid.getView().focusRow(record);
Sorry, I'm being really dumb. I just tried ensureVisible and it works fine.
This also seems to work
grid.getView().getNode(rowIndex).scrollIntoViewIfNeeded();
In case of ExtJs 4.X No need to use Ext.fly
To save you all a lot of hair pulling, you should know that the solutions in this thread for scrolling into view will not work if grid bufferedRenderer is turned on.
It is my understanding that in Ext JS 5, bufferedRenderer is turned on by default.
It took me a couple hours before I realized this.
grid.getView().getNode(rowIndex) will return NULL if the indexed row is outside the buffered rows.
In 4.2 at least, using scrollIntoViewIfNeeded fails if you're outside of the buffered range in a bufferedRenderer. The bufferedRenderer has a handy scrollTo method to help with this task though:
grid.getView().bufferedRenderer.scrollTo(index, true);
Scrolls to and optionlly selects the specified row index in the total dataset.
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.grid.plugin.BufferedRenderer-method-scrollTo

Resources