Change SPDataTable AddNEWItem caption

Hello

I am using the code below to change the SPDataTable AddNewItem CAPTION:

fd.created(function(vue) {
fd._vue.lang.SPDataTable_AddNewItem = “Bla Bla Bla”;
});

I am facing a scenario where i have multiples SPDataTable (Child sub lists) in one form and i need to give each one a different caption example:

1st SPDataTable (Customers)
InternalName: SPCustDT
fd.created(function(vue) {
fd._vue.lang.SPDataTable_AddNewItem = “New Customer”;
});

2nd SPDataTable (Products)
InternalName: SPprdDT
fd.created(function(vue) {
fd._vue.lang.SPDataTable_AddNewItem = “New Products”;
});

3th SPDataTable (Cases)
InternalName: SPCasesDT
fd.created(function(vue) {
fd._vue.lang.SPDataTable_AddNewItem = “New Case”;
});

How to do this for each SPDataTable

Thank you

Dear @gkhadra,

Please consider the following code for each of your SPDataTables:

$(fd.control("SPDataTable0").$el).find("button").text("New Text")

Thanks AlexZver for this helpful Script it works just great.

What about Sharepoint attachment control :
“Select files…” button.
How to change this caption name?
NB: it is a sharepoint attachment field not an SPDataTable.

instead of the caption “Select files…” i need to change it to ARABIC, in order to complete the whole form in Arabic interface.

Any updates about how the change the sharepoint attachment button caption ???

Dear @gkhadra,

I’m sorry for a late reply, thank you for the reminder. Please try this code:

$('.k-upload-button').text("New text")

Really AlexZver big thanks for your time, reply and concern much appreciated it works.

Dear @AlexZver
Sorry Again
the script:
$(’.k-upload-button’).text(“New text”)
worked for changing the caption of the button .

But if the button is pressed nothing is happening the attach process is not working.
i canceled the change the attachment trigger is working normally
are there anything to do about it?

Dear @AlexZver
Sorry i am disturbing you but any solution for this as i mentioned above the caption has changed but if i press the button nothing is happening the attachment trigger not working on caption change.

dear @AlexZver this script is not working anymore maybe it is about the latest sharepoint updates, are there another solution please

Dear @gkhadra,
Please, try the following JS for Attachments:

$('.k-upload-button span').text("New text");

And the following JS for List or Library:

$(fd.control("SPDataTable0").$el).find("button.btn-primary").text("New Text");

Just make sure that Internal Name of List or Library control is the same as you use it in code.

hI @Nikita_Kurguzov thank you again for your time
$(fd.control("SPDataTable0").$el).find("button.btn-primary").text("New Text"); is not workking
neither
$(fd.control("SPDataTable0").$el).find("button").text("New Text");

mention that the child list in the form is inside an accordian conatiner.

for the attachments $('.k-upload-button span').text("New text"); is working normally

Dear @gkhadra,
Please, try the following code for List or Library:

fd.spRendered(function() {
    fd.control("SPDataTable0").ready().then(function() {
        $(fd.control("SPDataTable0").$el).find("button.btn").text("New Text");
    });
});

Dear @Nikita_Kurguzov,
Thank you again and again for your help :grinning:
I forgot to add .ready function, i should remember this especially when i fire a script on load .