This is a migrated thread and some comments may be shown as answers.

[Solved] Change the text of update button in popup-editing

3 Answers 2384 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JMazeran
Top achievements
Rank 1
JMazeran asked on 16 Nov 2012, 02:38 PM

hi,

I have used a grid with popup editing. I want to use only the destroy et create command of the grid. Its working fine but i want to change the text of that Update and Cancel button in the popup.

For override text, i find this solution but it dysplay the edit button and i don't want to dysplay this button and not define Update action.

command.Edit().UpdateText("Custom Text").CancelText("Custom Text");

@(Html.Kendo().Grid<Modele>().Name("Grid")
                .ToolBar(toolbar => toolbar.Create())
                .Columns(columns =>
                {
                    columns.Bound(a => a.FirstName);
                    columns.Bound(a => a.LastName);                    
                    columns.Command(command =>
                    {
                        command.Edit().UpdateText("Custom Update").CancelText("Custom Cancel");
                        command.Destroy();
                    });
                })
                .Editable(editable => editable.Mode(GridEditMode.PopUp)
                .Window(w => w.Resizable()))
                .DataSource(dataSource => dataSource.Ajax().Batch(false)
                .ServerOperation(false)
                .Events(events => events.Error("error"))
                .Model(model => model.Id(a => a.FirstName))
                .Update(update => update.Action("FakeUpdate", "Controller"))
                .Read(read => read.Action("Read", "Controller"))
                .Create(read => read.Action("Create", "Controller"))
                .Destroy(read => read.Action("Destroy", "Controller"))))

Thanks.

3 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 21 Nov 2012, 01:37 PM
Hello Bouhou,

In order to achieve the desired outcome you could apply the solution you have found and hide the Edit button using CSS. For example: 
@(Html.Kendo().Grid<Modele>().Name("Grid")
   .ToolBar(toolbar => toolbar.Create())
   .Columns(columns =>
     {
      //....
           {
            command.Edit().UpdateText("Custom Update").CancelText("Custom Cancel");
            command.Destroy();
           });
     })
     //....
)
 
<style>
    .k-button.k-grid-edit {
       display: none;
    }
</style>

Regards,

Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
mark baer
Top achievements
Rank 1
answered on 25 Feb 2015, 07:31 PM
Is there a way to change the TEXT on the Update Button?  Currently ours says "Update".  I would like it to say "Save".  Also, can I add an Activity Indicator(Spinning ball) while the form is Updating?  Our Save takes 5-8 seconds...Thanks...
0
Alexander Popov
Telerik team
answered on 02 Mar 2015, 04:10 PM
Hello Mark,

In that case you can subscribe to the Grid's edit event handler. Once the event is triggered you can find the button in the e.container argument and either hide it or change its text accordingly.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
JMazeran
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
mark baer
Top achievements
Rank 1
Alexander Popov
Telerik team
Share this question
or