Results 1 to 3 of 3

Thread: is there a way to fill default values dynamically when adding a new record to a grid

  1. #1
    Sencha User mounir1's Avatar
    Join Date
    Jan 2018
    Location
    Turkey Antalya
    Posts
    10

    Default is there a way to fill default values dynamically when adding a new record to a grid

    So I have a grid with many columns, and a popup dialogue for adding new records.
    I have set deafultValues on data models fields array works fine, now I am trying to reuse that and add this defaults values dynamically from the server.
    I have entityName/def available in the server that have the feilds name with default values in it.
    - I have so many entities,
    so proxy transform function would be best ? or when creating the the dialogue form window call the the server to populate the fields ?
    I am new to Extjs and sencha and I don't have a clear way to both mentioned questions ;
    any answers are truly appreciated .

  2. #2
    Sencha User
    Join Date
    Jun 2017
    Posts
    25
    Answers
    1

    Default

    Maybe a column renderer function would be helpful? It intercepts the value before rendering it in the grid cell - you can then edit the value however you want before returning it and rendering it.

    https://docs.sencha.com/extjs/6.2.0/...l#cfg-renderer

  3. #3
    Sencha User mounir1's Avatar
    Join Date
    Jan 2018
    Location
    Turkey Antalya
    Posts
    10

    Default

    Thanks for the reply I acctually used a the service directly defining a new store for it .
    [CODE]
    {
    me.isEdit = !!record
    ; if (me.isEdit) {
    dataRec = dataStore.getById(record.get('gid')); }
    else {
    if (defStore)
    { phantomrec = defStore.data.items[0];
    dataRec = dataStore.insert(0, phantomrec)[0]; }
    else dataRec = dataStore.insert(0, {})[0];
    }
    },
    [CODE]

Similar Threads

  1. How to dynamically fill total row for grid in extjs4.1
    By vijayakumar84 in forum Ext: Q&A
    Replies: 1
    Last Post: 20 Jun 2013, 11:30 PM
  2. Help me fill a grid with the values of a store
    By dieg0 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 4 May 2010, 6:53 AM
  3. Fill grid from a record (save 1:n in a store's row)
    By wuschba in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 24 Dec 2008, 4:33 AM
  4. Dynamically adding values to columns in ColumnTree component using DWR
    By Paddy in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 20 Jun 2008, 7:07 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
  •