Archive for the ‘Code Patterns’ Category

Keeping modified records of EditorGridPanel while paging

Monday, September 28th, 2009

If you modify records of an editable grid with paging and if you then page-out, your changes are lost. Well, they are not lost in fact unless you have set pruneModifiedRecords:true on the strore. The modifications are still available so we just need to apply them. Here is the code ...

Inline Anonymous Funcion Pattern

Thursday, April 3rd, 2008

var msg = "From inline function"; var result = (function(m) { alert(m); return "Result of inline function"; }(msg)); alert(result);

Return Value of Function as items Pattern

Wednesday, April 2nd, 2008

,items:(function(){ var items = []; // populate items array return items; }).createDelegate(this)()

Defer Inline Anonymous Function Pattern

Wednesday, April 2nd, 2008

var text = 'Deferred'; (function() { alert(text); }.defer(2000, this));