Is there a way to add many 'edit' buttons to provide high level features ?

Is there a way to add many 'edit' buttons to provide high level features ?

EcoExpertiseInformatiqueEcoExpertiseInformatique Posts: 1Questions: 1Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Hi,

We need to add many 'edit' buttons to provide high level features to our customer. For each features, the columns to be updated could be different.

How can we manage this case using Editor ?

Thanks

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Answer ✓

    Hi,

    Yes, perfectly possible. Simply define different Editor instances, each with different fields, then attach them to the buttons something like:

    { extend: 'edit', editor: editor1, text: 'Edit 1' },
    { extend: 'edit', editor: editor2, text: 'Edit 2' },
    { extend: 'edit', editor: editor3, text: 'Edit 3' },
    

    Allan

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    You can have different buttons that show() / hide() different columns - something like this:

          {
            extend: "selected",
            text: "Edit Payroll",
            action: function(e, dt, node, config) {
              editor.hide().show(['name', 'salary']).
                 edit(dt.rows({selected: true}).ids().toArray(), {title: 'Edit Payroll', buttons:'Save'})          
            }
          } 
    

    Here's an example demonstrating that,

    Colin

Sign In or Register to comment.