[CLOSED] Editable datagrid

  1. #1

    [CLOSED] Editable datagrid

    Hi,

    I have an editable datagrid with 4-5 columns that are editable.

    Based on some business rules, i set values of some of the cells with use of "record.set(dataIndex,value)" in javascript. I can also change the cell values manually by editing it from UI.

    In both the cases, i can see the cell with "red triange" in left-top section of the control, telling me that the item has been modified or is dirty.

    I need a way to identify changes that were done manually (from UI by user) and changes that were done based on business rule with use of "record.set(dataIndex,value)".

    Is there a way i can identify and tell that this change was done by User and this change was done from codebehind code??

    Regards,
  2. #2

    RE: [CLOSED] Editable datagrid

    Hi,

    I don't know ehy it is required and how do you want to use that information but you can set some object to the record. This object will indicate about the change nature


    1. If you set a change then run the following code after 'record.set'
    record.changes = record.changes || {};
    record.changes[dataIndex] = true;

    2. If user changed the cell then need to reset to 'false'
    <AfterEdit Handler="e.record.changes = e.record.changes || {};  e.record.changes[e.field] = false;"/>

    You can use that 'record.changes' object as required
  3. #3

    RE: [CLOSED] Editable datagrid

    Hi,

    So it means that "AfterEdit" will not be called when we set value by using record.set(dataindex,value)?

    Regards,
  4. #4

    RE: [CLOSED] Editable datagrid

    So it means that "AfterEdit" will not be called when we set value by using record.set(dataindex,value)?
    Correct. I believe the AfterEdit event is fired only after a manual edit using the <Editor> field. You can test/confirm by configuring an AfterEdit Listener, then calling your record.set code.




    Geoffrey McGill
    Founder
  5. #5

    RE: [CLOSED] Editable datagrid

    Hi,

    I could not find any "AfterEdit" listener either in my editor (Combobox) or in the store.

    I am using Coolite 0.8.1.

    Am i missing something?

    Regards,
  6. #6

    RE: [CLOSED] Editable datagrid

    The <AfterEdit> Listener is available on the <ext:GridPanel>, see

    http://www.extjs.com/deploy/dev/docs...mber=afteredit


    Hope this helps.


    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] Problems with editable datagrid with combobox.
    By Patrick in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 01, 2010, 4:31 PM
  2. datagrid
    By grajaneesh in forum 1.x Help
    Replies: 1
    Last Post: Jul 12, 2010, 7:50 PM
  3. Replies: 1
    Last Post: Apr 13, 2010, 9:28 AM
  4. [CLOSED] DataGrid state
    By state in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 22, 2010, 4:22 PM
  5. [CLOSED] Datagrid TotalCount
    By testix in forum 1.x Help
    Replies: 8
    Last Post: Sep 16, 2009, 5:45 AM

Posting Permissions