PDA

View Full Version : Editing a single column constantly causes the browser to crash



ironhide707
13 Nov 2013, 5:59 AM
Hello all,
I have a grid and a store connected to it with three columns(Name, Progress , Size) . The thing is that i have entered a dummy record in the store and it shows perfectly. Now i am editing the 'Progress' column of the record constantly(i.e after every 1 second) but i am not committing the column. Now because of this i get the dirty record triangle( which is cool because i am not committing any data) but the problem is after like 10 to 12 cycles, my browser crashes :( . Can someone tell me what could be the problem. I think its because i am not committing any data that my browser crashes but then again its just my assumption.

Thanks.

scottmartin
14 Nov 2013, 8:39 PM
We would need to see some code to help. Feel free to use our fiddle to create a test case:
https://fiddle.sencha.com/#home

Here is some starter code:
http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.grid.plugin.CellEditing

ironhide707
17 Nov 2013, 10:43 PM
ok here it goes:

When a user clicks a button in my app this code is called:



var html = "<iframe width='0' height='0' src='dow.html?l="+ Ext.getCmp('txtURL').getValue() +"'></iframe>";
var grid = Ext.getCmp('DownGridPanel');
var records = [] ;
var Name = [html];
var Progress = ['1'];
var Size = ['100'];
var store = Ext.StoreMgr.lookup("VStore");
records.push({
Name: Name[0],
Progress: Progress[0],
Size: '100'
});




store.loadData(records);


After this 'dummy' record is pushed to the grid, the changing starts to take place. I have done it by getting the object of the grid by creating a method in 'app.html' and getting an object to grid in the dow.html which would in turn start to change the 'Progress' column:
The method in dow.html is somewhat like this:



function setVideoOffset(offset){
var record = store.getAt(0);
record.set('Progress',offset);


where, 'offset' is data which is provided after every second by an applet to 'dow.html' . Now the changing occurs on the grid but after 10 cycles by browser crashes. So if you can help me with this. It would be awesome :)

scottmartin
18 Nov 2013, 7:17 AM
As mentioned, you will need to provide a working example that duplicates your issue.

Also, you make no mention of the specific error. It is would be very difficult to guess what might be going wrong, but I suspect that your iframe approach if the culprit.

ironhide707
19 Nov 2013, 3:23 AM
Hey scott,
Thanks for the heads up. Turns out my approach was wrong about not committing the row. I created a logic which would in turn commit after every cycle and it turns out it works like a charm suddenly. I dunno if this is the correct way to do it and also as you mentioned i did some stupid mistakes in the HTML code embedded in the iframe too lol . But yeah the app is working fine now and i havent ran into any errors. Thank you scott for helping me out. Really mean a lot.