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

  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]
  2. #2
    Hi @speedstepmem4,

    Quote Originally Posted by speedstepmem4 View Post
    It will be good if you provide a prototype for all the workarounds. This will make the migration process smooth,
    Thank you for the suggestion. It would be such a challenge task, because the difference between ExtJS 3 (base of Ext.NET v1) and ExtJS 4 (base of Ext.NET v2) is huge.
  3. #3
    I sympathize with your challenge given that I had to go through the same process. In the end I am happy I did. Layout reliability went up, as did other things, but it was a challenge. I haven't seen anything on the client-side doing what you're requesting, and certainly on the server-side it would be daunting, if not implausible. The best advise I can give is take the upgrade one step and functionality at a time and you'll get there.

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. 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