or
// KendoUI grid
var
kgrid = $(
"#rate_grid"
).kendoGrid({
dataSource: {
data: get_rates(),
pageSize: 100
},
height: 360,
groupable:
false
,
scrollable: {
virtual:
true
},
sortable:
true
,
pageable:
false
,
columns: [ {
field:
"rate_name"
,
width:
'65px'
,
title:
"Name"
} , {
field:
"rate"
,
title:
"Rate"
} , {
field:
"high_rate"
,
title:
"High"
}],
rowTemplate: kendo.template($(
"#rowTemplate"
).html()),
dataBound: onDataBound
});
setInterval(
function
() {
// if KendoUI grid instance, update it
if
(
typeof
kgrid !==
"undefined"
)
{
$(
'#rates_load small'
).text();
var
re_grid = $(
"#rate_grid"
).data(
"kendoGrid"
);
var
new_grid_data = get_rates();
re_grid.dataSource.data(new_grid_data);
re_grid.refresh();
}
}, 5000);
<
div
id
=
"variantTabs"
></
div
>
<
div
id
=
"comboBox"
></
div
>
<
script
src
=
"http://code.jquery.com/jquery-1.7.1.min.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"kendoUI/js/kendo.all.js"
type
=
"text/javascript"
></
script
>
<
script
type
=
"text/javascript"
>
function Variant(_name,_id,_content){
this.text=_name;
this.id=_id;
this.content=_content;
}
function VariantsViewModel(){
var VariantsList=[
new Variant("first","1",""),
new Variant("second","2",""),
new Variant("third","3","")
];
var localDataSource = new kendo.data.DataSource({data: VariantsList});
$("#variantTabs").kendoTabStrip({
dataSource:localDataSource
});
$("#comboBox").kendoComboBox({
index: 0,
dataTextField: "text",
dataValueField: "id",
dataSource:localDataSource
});
}
$(function(){VariantsViewModel();});
</
script
>