[CLOSED] Prototype wrapper for ext 2.x to support ext 1.x

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Prototype wrapper for ext 2.x to support ext 1.x

    Hi

    We are facing many issues when migrating from Ext 1.x to 2.x, Especially in Javascript many methods have been moved / removed / updated.

    Eg. In the grid panel, .addRecord method is removed and to acheive this functionality we need to use store.insert,

    What we did is created a prototype for grid panel to make the old code work without changes. Please see below

    var protoTypeSettings = { Grid: { EditOnAdd: false } };
    
    
    Ext.grid.Panel.prototype.hello = function () { alert('hello'); }
    
    
    Ext.grid.Panel.prototype.addRecord = function () {
        var store = this.getStore();
        var dataLength = store.data.length;
        var model = new window[store.model.$className];
        store.insert(dataLength, model);
        var cellEditingPlugin = this.editingPlugin;
        if (cellEditingPlugin != null && cellEditingPlugin != undefined && protoTypeSettings.Grid.EditOnAdd)
            this.editingPlugin.startEdit(dataLength, 0);
        return dataLength;
    }
    
    
    Ext.grid.Panel.prototype.startEditing = function (rowIndex, colIndex) {
        var cellEditingPlugin = this.editingPlugin;
        if (cellEditingPlugin != null && cellEditingPlugin != undefined)
            this.editingPlugin.startEdit(rowIndex, colIndex);
    }
    It will be good if you provide a prototype for all the workarounds. This will make the migration process smooth,
    Last edited by Daniil; Oct 15, 2013 at 6:41 AM. Reason: [CLOSED]

Similar Threads

  1. Replies: 5
    Last Post: Dec 18, 2012, 3:41 AM
  2. Replies: 7
    Last Post: Dec 13, 2012, 11:55 AM
  3. [CLOSED] Ext.DatePicker.prototype.initComponent.createSeque nce
    By supera in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 20, 2012, 2:20 PM
  4. Problem with AjaxMethod and prototype
    By glenh in forum 1.x Help
    Replies: 4
    Last Post: Aug 24, 2009, 11:13 AM
  5. prototype scriptaculous
    By Ian in forum 1.x Help
    Replies: 2
    Last Post: Apr 24, 2009, 7:00 AM

Tags for this Thread

Posting Permissions