jQWidgets Forums

jQuery UI Widgets Forums Grid Changing cell value

This topic contains 1 reply, has 1 voice, and was last updated by  RedantJ 9 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Changing cell value #78717

    RedantJ
    Participant

    I am looking for the following:

    Before Edit:

    ----------------------
    | foo1 | foo2 | foo3 |
    ----------------------
    | Mary | 1111 | Ford |
    | Vlad | 2222 | _MG_ |
    | Lisa | 3333 | Saab |
    ----------------------

    Cell changed:

    ----------------------
    | foo1 | foo2 | foo3 |
    ----------------------
    | Mary | 1111 | Ford |
    | Vlad | ____ | _MG_ |
    | Lisa | 3333 | Saab |
    ----------------------

    Desired Effect:

    ----------------------
    | foo1 | foo2 | foo3 |
    ----------------------
    | Mary | 1111 | Ford |
    | Vlad | ____ | ____ |
    | Lisa | 3333 | Saab |
    ----------------------

    What’s happening right now:

    ----------------------
    | foo1 | foo2 | foo3 |
    ----------------------
    | Mary | 1111 | Ford |
    | Vlad | ____ | _MG_ |
    | Lisa | 3333 | Saab |
    ----------------------

    Requirement: In the row when the user changes the value in ‘foo2’, I want the value erased in ‘foo3’, as well.

    I’m unsure what is the correct way to go: cellvaluechanging, or cellendedit.

    Current code:

          {text: 'foo2', dataField: 'foo2', columntype: 'dropdownlist',
    	cellvaluechanging: function (row, datafield, columntype, oldvalue, newvalue) {
    		if (oldvalue != newvalue)
                    $("#jqxgrid").jqxGrid('setcellvalue', row, 'foo3', "");
    	},
            {text: 'foo3', dataField: 'foo3', columntype: 'dropdownlist'}
    Changing cell value #78720

    RedantJ
    Participant

    I found my answer here.

    It’s funny how us programmers can overthink things!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.