如何使用MVVM在Kendo网格中添加MaskedTextBox,DropDownList和AutoComplete [英] How to add MaskedTextBox,DropDownList and AutoComplete in Kendo grid Using MVVM
问题描述
对所有人的问候,
如何使用MVVM在Kendo网格中添加MaskedTextBox,DropDownList和AutoComplete ???
使用dataSouce我可以,但在MVVM中我不知道如何添加。
这里我正在使用dataSource分享我的代码
{字段:'PhoneNumber',标题:'PhoneNumber',编辑:MaskedPhoneNumber},
现在我正在调用这个函数
函数MaskedPhoneNumber(容器,选项){
$(' < input data-bind =value:' + options.field + ' />)
.appendTo(container)
.kendoMaskedTextBox({
掩码: 〜00-0000000000,
// 值:+ 91
规则:{
〜:/ [+] /
}
});
}
这很好。现在我在MVVM中分享我的代码
data-role =grid
data-sortable =true
data-editable =true
data-toolbar =['创建','保存','取消']
data-reorderable =true
data-resizable =true
data-columns ='[
{字段:PhoneNumber,标题:PhoneNumber},//这里如何添加编辑器
{field:Country,title:living country,width:180},
{field:StateName,title:State Belongs to},
{command:[destroy]}]'
data-bind =source:personsDataSource>
帮我解决这个问题,
先谢谢你。
(' < input data-bind =value:' + options.field + ' />')
.appendTo( container)
.kendoMaskedTextBox({
mask: 〜00-0000000000 ,
// 值:+ 91
规则:{
〜:/ [+] /
}
}) ;
}
这很好。现在我在MVVM中分享我的代码
data-role =grid
data-sortable =true
data-editable =true
data-toolbar =['创建','保存','取消']
data-reorderable =true
data-resizable =true
data-columns ='[
{字段:PhoneNumber,标题:PhoneNumber},//这里如何添加编辑器
{field:Country,title:living country,width:180},
{field:StateName,title:State Belongs to},
{command:[destroy]}]'
data-bind =source:personsDataSource>
帮我解决这个问题,
先谢谢。
Greetings of the day to all,
How to add MaskedTextBox,DropDownList and AutoComplete in Kendo grid Using MVVM ???
using dataSouce I can,but in MVVM i don't know how to add.
Here i'm sharing my code using dataSource
{ field: 'PhoneNumber', title: 'PhoneNumber', editor: MaskedPhoneNumber },
now i'm calling this function
function MaskedPhoneNumber(container, options) {
$('<input data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoMaskedTextBox({
mask: "~00-0000000000",
//value: "+91"
rules: {
"~": /[+]/
}
});
}
this is fine. Now i'm sharing my Code in MVVM
data-role="grid"
data-sortable="true"
data-editable="true"
data-toolbar="['create','save','cancel']"
data-reorderable="true"
data-resizable="true"
data-columns=' [
{ field: "PhoneNumber", title: "PhoneNumber" },//here how can i add editor
{ field: "Country", title: "living country", width: 180 },
{ field: "StateName", title: "State Belongs to" },
{ command: ["destroy"]}] '
data-bind="source: personsDataSource">
help me how to solve this,
Thanks in advanced.
('<input data-bind="value:' + options.field + '"/>') .appendTo(container) .kendoMaskedTextBox({ mask: "~00-0000000000", //value: "+91" rules: { "~": /[+]/ } }); }
this is fine. Now i'm sharing my Code in MVVM
data-role="grid"
data-sortable="true"
data-editable="true"
data-toolbar="['create','save','cancel']"
data-reorderable="true"
data-resizable="true"
data-columns=' [
{ field: "PhoneNumber", title: "PhoneNumber" },//here how can i add editor
{ field: "Country", title: "living country", width: 180 },
{ field: "StateName", title: "State Belongs to" },
{ command: ["destroy"]}] '
data-bind="source: personsDataSource">
help me how to solve this,
Thanks in advanced.
这篇关于如何使用MVVM在Kendo网格中添加MaskedTextBox,DropDownList和AutoComplete的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!