Results 1 to 2 of 2

Thread: Adding a new item on taskEditor (Kanban)

  1. #1
    Sencha User
    Join Date
    Jan 2018
    Posts
    2
    Vote Rating
    0
      0  

    Default Adding a new item on taskEditor (Kanban)

    Hello,
    I want to add a new item to my task editor. I never used the ExtJS or Bryntum, but I have been asked to add this field to the task editor.
    So I have the Follow editor, how can I add a new item and save it to Database? I tried just copy and paste a new item on items array and it doesn't work.
    The new item is showed in ​
    Code:
    win.form.getForm().getValues()
    console.log but it's not saved.
    What am I missing?



    Code:
    Ext.define('Kanban.blabla.view.TaskEditor', {
        extend: 'Ext.Window',
    xtype: 'taskeditor',
    
    /**
         * @cfg {String} triggerEvent The event that should trigger the editing to start. Set to null to disable the editor from being activated.
         */
    triggerEvent: 'taskdblclick',
    
    title: 'Task details',
    width: 300,
    bodyPadding: 10,
    form: null,
    closeAction: 'hide',
    items: [
            {
                xtype: 'form',
    items: [
                    {
                        xtype: 'textfield',
    fieldLabel: 'Name',
    name: 'Name',
    allowBlank: false
    },
    {
                        xtype: 'combobox',
    store: 'userstore',
    queryMode: 'local',
    name: 'ResourceId',
    displayField: 'Name',
    valueField: 'Id',
    fieldLabel: 'Assigned to'
    },
    {
                        xtype: 'numberfield',
    name: 'Duration',
    fieldLabel: 'Estimate (days)'
    }
                ]
            }
        ],
    
    buttons: [
            {
                text: 'Save',
    handler: function () {
                    var win = this.up('window');
    
    if (win.form.isValid()) {
                        win.form.updateRecord();
    win.hide();
    }
                }
            },
    {
                text: 'Cancel',
    handler: function () {
                    this.up('window').hide()
                }
            }
        ],
    
    editRecord: function (record) {
            this.record = record;
    this.form.getForm().loadRecord(record);
    
    this.show();
    },
    
    initComponent: function () {
            this.callParent(arguments);
    
    this.form = this.down('form');
    
    },
    
    init: function (taskboard) {
    
            if (this.triggerEvent) {
                taskboard.on(this.triggerEvent, function (pnl, record, node, e) {
                    this.editRecord(record);
    }, this);
    }
        }
    });
    

  2. #2
    Sencha Premium User mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,153
    Answers
    33
    Vote Rating
    203
      0  

    Default

    Quote Originally Posted by guifeliper View Post
    Hello,
    I want to add a new item to my task editor. I never used the ExtJS or Bryntum, but I have been asked to add this field to the task editor.
    So I have the Follow editor, how can I add a new item and save it to Database? I tried just copy and paste a new item on items array and it doesn't work.
    The new item is showed in ​
    Code:
    win.form.getForm().getValues()
    console.log but it's not saved.
    What am I missing?



    Code:
    Ext.define('Kanban.blabla.view.TaskEditor', {
        extend: 'Ext.Window',
    xtype: 'taskeditor',
    
    /**
         * @cfg {String} triggerEvent The event that should trigger the editing to start. Set to null to disable the editor from being activated.
         */
    triggerEvent: 'taskdblclick',
    
    title: 'Task details',
    width: 300,
    bodyPadding: 10,
    form: null,
    closeAction: 'hide',
    items: [
            {
                xtype: 'form',
    items: [
                    {
                        xtype: 'textfield',
    fieldLabel: 'Name',
    name: 'Name',
    allowBlank: false
    },
    {
                        xtype: 'combobox',
    store: 'userstore',
    queryMode: 'local',
    name: 'ResourceId',
    displayField: 'Name',
    valueField: 'Id',
    fieldLabel: 'Assigned to'
    },
    {
                        xtype: 'numberfield',
    name: 'Duration',
    fieldLabel: 'Estimate (days)'
    }
                ]
            }
        ],
    
    buttons: [
            {
                text: 'Save',
    handler: function () {
                    var win = this.up('window');
    
    if (win.form.isValid()) {
                        win.form.updateRecord();
    win.hide();
    }
                }
            },
    {
                text: 'Cancel',
    handler: function () {
                    this.up('window').hide()
                }
            }
        ],
    
    editRecord: function (record) {
            this.record = record;
    this.form.getForm().loadRecord(record);
    
    this.show();
    },
    
    initComponent: function () {
            this.callParent(arguments);
    
    this.form = this.down('form');
    
    },
    
    init: function (taskboard) {
    
            if (this.triggerEvent) {
                taskboard.on(this.triggerEvent, function (pnl, record, node, e) {
                    this.editRecord(record);
    }, this);
    }
        }
    });
    
    Try asking in the Bryntum forums? www.bryntum.com/forum

Similar Threads

  1. Kanban Task Board Component
    By mankz in forum Ext:User Extensions and Plugins
    Replies: 16
    Last Post: 10 Oct 2014, 5:31 PM
  2. Kanban panel Architect extension
    By ragzovskii in forum Sencha Architect User Extensions/Templates
    Replies: 2
    Last Post: 23 May 2014, 10:16 AM
  3. Digital Touch Kanban Board
    By tobinharris in forum Sencha Touch 1.x: Examples and Showcases
    Replies: 1
    Last Post: 16 Jan 2014, 1:19 PM
  4. Update store when adding item makes doubling the item
    By tcozien in forum Ext GWT: Discussion
    Replies: 2
    Last Post: 3 Dec 2010, 7:09 AM
  5. Ext-Kanban - alternative approach to custom building
    By SamuraiJack1 in forum Sencha Cmd
    Replies: 0
    Last Post: 25 Jul 2008, 7:29 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •