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

Column Titles from DB / variables

3 Answers 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
harsh
Top achievements
Rank 1
harsh asked on 23 Apr 2014, 02:44 PM
Hi guys,
Is it possible to use variables for titles in Grids.I am trying to do internationalization so that Title can come from DB / CMS system .

editable : "inline",
columns : [
{
field : "OrderID",
title : '$T_OO1', <--------instead of "Order ID"
filterable : true,
width : '20%'
},

3 Answers, 1 is accepted

Sort by
0
harsh
Top achievements
Rank 1
answered on 23 Apr 2014, 06:49 PM
All,
Just an update.I was able to get the handle of the title variable/attribute by the following code but it is not reflecting in UI,Any hints ?


$("#grid").ready(function(){
  $test=$("#grid").find('.k-header:nth-child(4)');
  console.log($test.attr('data-title'));
  $test.attr('data-title','');
  $test.attr('data-title','aaaaa');
  console.log($test.attr('data-title'));
});

0
harsh
Top achievements
Rank 1
answered on 23 Apr 2014, 09:43 PM
Found the solution

$("#grid thead [data-field=Freight]").text("ABC");
0
Dimiter Madjarov
Telerik team
answered on 24 Apr 2014, 01:38 PM
Hello  Harsh,


Regarding the variable question, if it is evaluated during page load, there should not be any problem in using it. For example in an ASP.NET MVC environment you could set it like this:
field: "OrderDate",
title: "@ViewBag.Title"

As for the solution from the last post, it will cause issues when the filter/column menu is enabled as it will remove the filter icon.

Regards,
Dimiter Madjarov
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
harsh
Top achievements
Rank 1
Answers by
harsh
Top achievements
Rank 1
Dimiter Madjarov
Telerik team
Share this question
or