-
30 Jul 2010 8:17 AM #1
If a row is selected and the data refreshes and the record is gone what happens?
If a row is selected and the data refreshes and the record is gone what happens?
Easy answer would be to change the data and see, however I dont have access to modifying the data (dont ask).
Wondering what occurs when a user selects a record in the GridPanel and reloads the datastore (not the browser).
I know that when it is reloaded the selected row gets selected again.
But, what happens if the record was removed since last load?
Does the GridPanel select the row based on the actual content of the row? or does the GridPanel select the row based on the row index?
If user selects row 3 which contains data: RED and reloads the store and RED has been removed from the store will the grid still select row 3 which contains data: BLUE? OR nothing gets selected
I am unable to test this currently until somebody fixes the management tool and want to know if this is something I am to test for or not.
-
30 Jul 2010 9:07 AM #2
From what I can see in the code for RowSelectionModel, it is based on rowIndex. See onRefresh:
Code:onRefresh : function(){ var ds = this.grid.store, index; var s = this.getSelections(); this.clearSelections(true); for(var i = 0, len = s.length; i < len; i++){ var r = s[i]; if((index = ds.indexOfId(r.id)) != -1){ this.selectRow(index, true); } } if(s.length != this.selections.getCount()){ this.fireEvent('selectionchange', this); } },
-
2 Aug 2010 6:53 AM #3
-
2 Aug 2010 6:58 AM #4
onRefresh is a private method of RowSelectionModel so won't be in the API docs. See line 71054 in ext-all-debug-w-comments.js.
-
2 Aug 2010 7:02 AM #5
-
2 Aug 2010 7:13 AM #6
Yep. That's the best way to know software. To understand it. It's not rocket science. It's just Javascript.
And it's all broken down into reasonably sized classes.
Just look at RowSelectionModel.js
It's only 500 lines of which at least 200 is comments.
You should be able to see how it works.
So yes, I'm ROFLing at people who close off this to themselves, and refuse to learn.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
2 Aug 2010 8:44 AM #7
Well, thanks for the file name to review, but aside from that, I must disagree with you on this Animal. A library with an API is suppose to cover how the items are to be used. I agree its not rocket sciene but to expect people to just go look into source code for something that may or may not be there and for them to not know what they are looking for exactly because they don't know if it exists just to see if it exists is just well beyond reason. I've run into this kind of stuff many times in the past where it's like saying
Convoluted."I am looking to perform X and I am not sure if the library I am using can do it, but I know if I look into every file thats in the library for the term that I think it will be called (I don't know what they may list it under), I may not waste a whole lot of time and get the answer I am looking for. Then again I might not"
-
2 Aug 2010 9:29 AM #8
I've read and stepped through nearly every line of source in the library. You just get to know how it works.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
2 Aug 2010 10:31 AM #9Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,167
- Vote Rating
- 29

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
2 Aug 2010 10:49 AM #10
Wow!
I don't get you guys sometimes. That line of thinking to me is so off. It would be like expecting people when using JAVA libraries that it's a given that they have to unjar the libraries and decompile the source to view the content in order to look and see if a method exists before writing their own code to do something because a method may already be available but may not have documented in the API.
Are both of you saying people should do that?
Similar Threads
-
How to get id of record for selected row in GridPanel?
By bbxx in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 18 Oct 2009, 5:30 PM -
How to display a row of data once selected
By DantesInferno in forum Ext 1.x: Help & DiscussionReplies: 4Last Post: 31 Jul 2009, 6:53 AM -
Retrieving data from selected row in grid
By janixams in forum Ext 1.x: Help & DiscussionReplies: 6Last Post: 10 Jun 2008, 6:19 PM -
How can I convert a selected row data to a javascript object
By burgleboy711 in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 28 Dec 2006, 3:48 AM -
How to get the data of a selected Row?
By next2you in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 13 Sep 2006, 12:18 PM


Reply With Quote