Is it possible to set the title of an Editor form dynamically?
Is it possible to set the title of an Editor form dynamically?
pansengtat
Posts: 66Questions: 26Answers: 1
in Editor
Currently, the title of the Editor form can be changed directly using il8n
as follows:
editor = new $.fn.dataTable.Editor({
ajax: "myPage.php",
table: "#myWebTable",
fields: [
{
label: "My field label: ",
name: "mySelectedTable.selectedColumn"
}
],
i18n: {
edit: {
title: "This appears in the Editor title",
submit: "Confirm"
}
}
});
However, if I wish to get data from a column and concatenate it to the Editor title, how do I do so?
i18n: {
edit: {
title: "This appears in the Editor title " + "mySelectedTable.selectedColumn",
submit: "Confirm"
}
}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Depending on your initialisation order you might need to use the
open
event and then thetitle()
method to set the title.If you initialise Editor after the DataTable you could probably do the above (although to get the title use
$( myTable.column( ... ).header() ).text()
rather than giving it a string).Allan
This is what I churned out, hope this helps: