-
24 Feb 2007 7:28 AM #1
Grid DataModel keeps data in memory
Grid DataModel keeps data in memory
Hello , I am newbie at yui-ext and yui-ext is THE THE most js lib I saw.
Thank you Jack.
Anyway I have litle problem I use Xajax for creating array to supply my js function which is loads
in my init.js.
Basicly my idea work like this.
init.js -- loads grids and other stuff
the i have litle
function load_nzp(mydata_array) {
This setups the grid and shows it .
}
now from xajax i call load_nzp(mydata_array); and send my array
Now everything display good , but then i try to do a click event and take data from grid.
Then I tryed this.
Then I try to load againg some ether data into the grid.Code:var onRowClick = function(grid, rowIndex, e) { qq=grid.dataModel.getValueAt(rowIndex, 0) alert(qq); } var grid = new YAHOO.ext.grid.Grid('inner2', dataModel, colModel); grid.addListener('rowclick', onRowClick); this.grid = grid; grid.render();
Everything display fine in a grid.
But when i try to click on grid row I get old data and get two alerts oldvalue and new value.
So evry time when i call from xajax load_nzp(new_data_array) i get oldarrays+new_data_array.
Probably my concept is not good or I am mising something.
So if somone would be kind to help with this problem i would be very greatfull.
Thank you
-
24 Feb 2007 11:15 AM #2
Here is the live example of the problem With XML load
Here is the live example of the problem With XML load
I made some example do demonstrate the problem here is the url
http://tane.grappoloin.com/yui-ext/e.../xml-grid.html
just clik on data1 or data2 button then click on some row in grid
you will see the problem.
I probaly doing something wrong but I just do not have clue what is it
-
24 Feb 2007 12:38 PM #3
Well, you're calling XmlExample.loadGrid when the button is pressed.
That's already been called once. You're adding that function as a listener again!
Basic organization! Init the grid and listeners in the init function! load the grid in the load function.
Similar Threads
-
Grid: Paging of JavaScript Array already in memory
By Preston in forum Ext 1.x: Help & DiscussionReplies: 34Last Post: 1 Oct 2012, 4:40 AM -
JSON Grid Datamodel Example/Help
By ojintoad in forum Ext 1.x: Help & DiscussionReplies: 12Last Post: 22 Feb 2010, 6:10 AM -
[SOLVED] Memory Leak in Paging Grid Example?
By cobnet in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 3 May 2007, 8:24 PM -
1.0a3 grid drains cpu when the dataModel fetched 0 records
By neongrau in forum Ext 1.x: BugsReplies: 3Last Post: 20 Mar 2007, 10:26 PM -
Setting JsonView and DataModel data from existing JSON obj
By slacker775 in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 18 Jan 2007, 3:35 PM


Reply With Quote