Results 1 to 3 of 3

Thread: Enabling Editing using custom button

  1. #1
    Sencha User
    Join Date
    Jul 2018
    Posts
    3
    Vote Rating
    0
      0  

    Default Enabling Editing using custom button

    Hi everyone, hope I posted in the right section.
    I'm very new to sencha, and javascript/html/css/ecc.. in general. I've started using the given examples and modifying them. In particular I'm using the Basic Grid from the Classic theme. I've made some changes and also enable editing. Now I want to make something different but really don't know how. I want to make a button outside the grid that on click enable/disable the cell editing plug-in.
    Thanks for the help!!!

    The code i'm using:
    Ext.application({
    name: 'MyApp',
    launch: function () {
    Ext.create('Ext.grid.Panel', {
    title: 'Classic Grid',
    store: store,
    plugins: {
    cellediting: true
    },
    viewConfig: {
    enableTextSelection: true,
    stripeRows: false,
    getRowClass: function(record) {
    return record.get('height') < 1.1 ? 'child-row' : 'adult-row';
    }
    },
    columnlines: true,
    controller: 'grid',
    collapsible: true,
    multiSelect: true,
    columns: [
    {text: 'Name', width: 100, dataIndex: 'name', locked:true},
    {text: 'Email Address', width: 200, dataIndex: 'email', editor: 'textfield'},
    {text: 'Phone Number', width: 200, dataIndex: 'phone'},
    {text: 'Height [m]', width: 200, dataIndex: 'height'},
    {text: 'Weight [kg]', width: 200, dataIndex: 'weight', formatter: 'round(2)'},
    {text: 'Occupation', width: 200, dataIndex: 'work'},
    {text: 'Hobby', width: 200, dataIndex: 'hobby'},
    {text: 'Color', width: 200, dataIndex: 'color'},
    {text: 'Phone Number', width: 200, dataIndex: 'phone'},
    {text: 'Height [m]', width: 200, dataIndex: 'height'},
    {text: 'Weight [kg]', width: 200, dataIndex: 'weight'},
    {text: 'Occupation', width: 200, dataIndex: 'work'}
    ],
    width: 1000,
    height: 600,
    forceFit: true,
    renderTo: Ext.getBody()
    });
    }});

    function onClick(sender, record) {
    var r = record[0].data;
    var text = r.name+' - '+r.email+' - '+r.phone+' - '+r.height+' - '+r.weight+' - '+r.work+' - '+r.hobby;
    alert(text);
    };

    var store = Ext.create('Ext.data.Store', {
    fields: ['name', 'email', 'phone', 'height', 'wheight', 'work', 'hobby'],
    data: [
    {'name':'Lisa', "email":"[email protected]", "phone":"555-111-1224", "height":"1", "weight":"30.4444", "work":"student", "hobby":"Jazz", "color":"red"},
    {'name':'Bart', "email":"[email protected]", "phone":"555-222-1234", "height":"1", "weight":"40", "work":"student", "hobby":"Prank", "color":"blue"},
    {'name':'Homer', "email":"[email protected]", "phone":"555-222-1244", "height":"1,8", "weight":"100", "work":"nuclear plant", "hobby":"Beer", "color":"green"},
    {'name':'Marge', "email":"[email protected]", "phone":"555-222-1254", "height":"1,7", "weight":"60", "work":"housewife", "hobby":"Paint", "color":"yellow"}
    ]
    });

  2. #2
    Sencha User
    Join Date
    Feb 2017
    Posts
    15
    Answers
    3
    Vote Rating
    2
      0  

    Default

    This is how you edit manually when you have cellediting plugin:
    https://fiddle.sencha.com/#view/editor&fiddle/2jov

    rawediting:
    https://fiddle.sencha.com/#view/editor&fiddle/2f9k

  3. #3
    Sencha User
    Join Date
    Jul 2018
    Posts
    3
    Vote Rating
    0
      0  

    Default

    I'm sorry for the late reply. Thanks beso9595, but this is not exactly what I have in mind. Maybe I express myself wrong, what I want is that:
    The button should just change the properties of cellediting from false to true and viceversa, then as usual we can edit by clicking on the cell.
    thanks again for the answer

Similar Threads

  1. Replies: 7
    Last Post: 10 Aug 2012, 6:51 AM
  2. [FIXED] Ext.form.field.File enable is not enabling the button
    By ryan.mcgee in forum Ext:Bugs
    Replies: 3
    Last Post: 26 Jun 2012, 1:48 PM
  3. Enabling button on grid row select
    By hworg in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 3 Jun 2009, 5:07 AM
  4. enabling combo box once button pressed
    By bhaskar1605 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 31 Dec 2008, 5:46 AM
  5. Enabling text box on selection of radio button
    By bbalaganapathy in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 28 May 2008, 3:55 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
  •