Datatables.net Editor "type: select"

Datatables.net Editor "type: select"

d052057d052057 Posts: 38Questions: 3Answers: 0

I have an issue with 'type: select" in DT editor. I've searched around but I cannot find any discussions about it. Basically, I have 3 columns (let say Col_A, Col_B, Col_C. The Col_A field type is Select. Col_B and Col_C are just plain input text box.
I would like to fill Col_B with Col_A.value and Col_C with Col_A.label or Col_A.Text.
Any suggestions or any link I can view the example of how to do it?
I prefer to do it in 'preSubmit' and/or in the Editor Entry mode.

For Alen:
My company purchase DT editor but it is under different user name, Can you or some one else transfer the register to my login?
If you can, I can provide you information as you required.

Thanks.

Replies

  • allanallan Posts: 61,726Questions: 1Answers: 10,109 Site admin

    Hi,

    If you could let me know the invoice number I'll get it transferred over.

    Regarding your question - dependent() would be the way to do this. The one issue there though is that Editor doesn't normally give access to the label of the selected value for select. You'd need to use a little jQuery for that. e.g.

    editor.dependent( 'Col_A', function ( val, data, cb ) {
      return {
        values: {
          Col_B: val,
          Col_C: editor.field('Col_A').input().find('option:selected').text()
        }
      };
    } );
    

    Allan

  • d052057d052057 Posts: 38Questions: 3Answers: 0

    Thank you for the codes. The codes are very helpful. It leads me to the other things like extension prices or calculated fields etc.

    The invoice number is 8576.

This discussion has been closed.