Change titleAttr in language file
Change titleAttr in language file
kitcat
Posts: 12Questions: 1Answers: 0
hi
i must change language of dataTable in 3 language
i used this code:
text: '<i class="fa fa-print"></i>',
titleAttr: 'Print',
autoPrint: true,
extend: 'print',
And i need change titleAttr in Language file
i used this but cant change
"buttons": {
"print": {
"text": "test text",
"titleAttr": "test titleAttr"
}
}
please help me
thank you
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Unfortunately that it not something that is currently possible to change from the Ajax loaded JSON language file. You would need to get the language information (using
i18n
) after the initialisation is complete (initComplete
) and either apply the attribute directly to the button or initialise the Buttons with that attribute at that point.Regards,
Allan
hi
thank you for anwser
i read the manual completly and i know this solution
if you can commit this problem
that is very important for multi language users
Regards.
mousavi
I agree and this is something I would like to see added myself. I hope to get a chance to implement it in future.
Regards,
Allan
hello again
i dont know how use i18n
but i use this code:
but dont like this code and don't perform for buttons-colvis or buttons-page-length
i need a loop for process all buttons and change that title
if this loop can save to me parent and child (for buttons-colvis or buttons-page-length)
that's very awesome
are you can tips me?
i use this code but dont work for me
but i cant change titleAttr
I did not pay for this component
but i think i must use i18n.edit
and thats for sell
are this true?
i use this
OR
but cant acess to titleAttr
No the
titleAttr
can't be updated dynamically - you need to update the node directly if you are using that technique:Allan
im sorry
this code give me an error on mtable.i18n('button.copy')
jquery.min.js:1 Uncaught TypeError: Cannot read property 'replace' of undefined
at s.<anonymous> (datatables.min.js:180)
at s.i18n (datatables.min.js:142)
at m.fn.init.initComplete (functions.js:428)
at datatables.min.js:115
at Function.map (jquery.min.js:1)
at r (datatables.min.js:115)
at ua (datatables.min.js:88)
at ha (datatables.min.js:88)
at e (datatables.min.js:132)
at b (datatables.min.js:112)
Hi @kitcat ,
Yep, there was a mistake in that example,
i18n()
needs a second argument, so it should beSee live example here,
Cheers,
Colin
Oops - thanks Colin!
thank you very much
that is work for me
i change my solution because my project does not have a powerful language manager
but this topic is very helpful for the othe one
thanks again
best regards