i want to add dynamic dropdown in a datatable currenty its just displaying dynamic data

i want to add dynamic dropdown in a datatable currenty its just displaying dynamic data

syedhassansyedhassan Posts: 1Questions: 1Answers: 0

here is the view file which triggers the status in the data table:

        targets: 7,
        className: "det stsarea",
        render: function (data, type, full, meta) {
          if (full['status'] == "0") {
              return "Incomplete";
            } else if(full['status'] == "1") {
            return "Completed";
          } else if(full['status'] == "2") {
            return "Cancelled";
          }
        }
      },
    ],

I want to change this status format to a dropdown from where I can change the status on click

also the whole row is bind with a modal I want to detach status dropdown from that modal so that I can change the status when I click on the dropdown please also help me with that

if any other detail is needed i will provide

What I have tried:

I've tried to add a dropdown but its not dynamic

targets: 7,
className: "det stsarea",
render: function (data, type, full, meta) {
var dropdown = '';
if (full['status'] != null) {
dropdown += '';
 dropdown += 'Incomplete';
 dropdown += 'Completed';
 dropdown += 'Cancelled';
 dropdown += '';
                    }
                    return dropdown;
                }
            },

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    edited August 2022

    It would be worth looking at Editor, as the select would give you that element, please see example here.

    Colin

Sign In or Register to comment.