select fields type
select fields type
Hi i use in data tables a static select menu sometring like.
type: "select",
options: [
{ label: "Z", value: 1 },
{ label: "Y", value: 2 },
{ label: "X", value: 3 }
]
I don't be able to show field label , datatables always show filed value.
I use render: with 3 condition con value and everything is ok, but there isn't a better way to do this more clear ?
In editor everything is ok label i showing without "if".
This question has an accepted answers - jump to answer
Answers
Is this using Editor? This example may help.
If that doesn't help, I didn't fully understand your question, so could you link to your page of modify this test case to demonstrate the problem please,
Colin
Hi thank for your help, my problem is related to the Datatables not to the editor. Datatables Show fields value not Label value of select type.
In datatables i defined the select like this
I need to do
to make datatables grid showing correctly label and not values.
There is a better method without use of "render: function"?
I prefer do not make too much "if" condition in my code.
Thanks a lot
columns.type
doesn't have aselect
option, that's only for Editor'sfields.type
.What you're doing is probably correct if you just want the static value being shown, otherwise yep, you could return the HTML for the
select
incolumns.render
(there are a few examples on that page doing that),Colin
Hi Colin, thanks