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

Localization without call Columns.Command

2 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JC Software Services, Inc.
Top achievements
Rank 1
JC Software Services, Inc. asked on 14 Aug 2015, 08:32 AM

When use Grid edit command without calling GridActionColumnFactory.Edit(). GridBuilder would not render localization script for the popup edit. Just like the code.

@(Html.Kendo().Grid<ProduceViewModel>()
    .Name("grid")
    .DataSource(datasource=>
        /*...*/
    )
    .Columns(columns =>
    {
        columns.Bound(m => m.ProductId).ClientTemplate("<a onclick='edit(this)'>#=ProductId#</a>");
        columns.Bound(m => m.ProductName);
        columns.Command(command =>
        {
            command.Destroy();
        });
    })
)

2 Answers, 1 is accepted

Sort by
0
JC Software Services, Inc.
Top achievements
Rank 1
answered on 14 Aug 2015, 08:34 AM

javascript code

function edit(el) {
    var grid = $("#grid").data("kendoGrid");
    var row = $(el).closest("tr");
 
    grid.editRow(row);
}

0
Daniel
Telerik team
answered on 18 Aug 2015, 07:59 AM
Hello,

The update and cancel text options are part of the edit command configuration so if the command is not included, the localized messages will not be available. You can  include the edit command and hide the column:
columns.Command(command =>
{
    command.Edit();
}).Hidden(true);

or include the command to destroy command column and hide the button via CSS:
columns.Command(command =>
{
    command.Edit();
    command.Destroy();
});
#grid .k-grid-edit
{
    display:none;
}
or include the kendo.messages file in order to localize the text.

Regards,
Daniel
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
JC Software Services, Inc.
Top achievements
Rank 1
Answers by
JC Software Services, Inc.
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or