Hello, have grid with popup In pop-up add/edit ID column which is hidden in data-column declaration shows up in pop-up Add/Edit Window of grid and ExpiryDate which is type in DataSource schema its editor is coming as Textbox, i want to replace by DateTime picker.
I want to resolve following things.
1) Some fields like "ID" want to be hidden in Popup Add/Edit mode and set default ID value for item to be 0
2) For should be DatePicker in Popup Add/Edit mode
3) I want to mask in showing "#" in all number only showing last 4 .
4) OriginalCardNumber has credit card is there any way by which we can calculate OriginalCardNumber to Masked CardNumber for value in CardNumber field
here is the code:
I want to resolve following things.
1) Some fields like "ID" want to be hidden in Popup Add/Edit mode and set default ID value for item to be 0
2) For should be DatePicker in Popup Add/Edit mode
3) I want to mask in showing "#" in all number only showing last 4 .
4) OriginalCardNumber has credit card is there any way by which we can calculate OriginalCardNumber to Masked CardNumber for value in CardNumber field
here is the code:
<
div
data-role
=
"window"
id
=
"ImportPNRCreditCardPricingSettlementWindow"
data-animation
=
"false"
data-title
=
"Card Details"
data-modal
=
"true"
data-visible
=
"false"
data-bind
=
"visible: isCreditCardCRUDWindowVisible, events:{open: OnImportPNRCreditCardWindowOpened}"
>
<
div
data-role
=
"grid"
id
=
"ImportPNRCreditCardGrid"
data-editable
=
'{"mode" : "popup", "confirmation" : "Are you sure you want to delete this Item?"}'
data-toolbar
=
"['create']"
data-columns='[
{ "field": "ID",hidden: true },
{"field": "lkpTypeName", hidden: true },
{"field": "CardName", title:"Name"},
{"field": "CardNumber", title:"CardNumber"},
{"field": "OriginalCardNumber", hidden: true },
{"field": "ExpiryDate", title:"Expiry Date"},
{"field": "IssuingCompany", title:"Issuing Company"},
{"field": "BillingEmail", title:"Billing Email"},
{"field": "ValidFrom", title:"Valid From"},
{ command: ["edit", "destroy"], title: " ", width: "250px" }
]'
data-bind
=
"source: UserDefinedCreditCardDS"
></
div
>
Script:
function
ImportPNRCreditcardDS() {
new
kendo.data.DataSource({
data: [],
schema: {
model: {
id:
"ID"
,
fields: {
ID: { type:
"number"
},
lkpTypeName: { type:
"string"
},
CardName: { type:
"string"
},
CardNumber: { type:
"string"
},
OriginalCardNumber: { type:
"number"
},
ExpiryDate: { type:
"date"
},
IssuingCompany: { type:
"string"
},
BillingEmail: { type:
"string"
},
ValidFrom: { type:
"date"
},
CreditCardType: { type:
"string"
},
CreditCardCategory: { type:
"string"
}
}
}
}
});
}
Inside ViewModel , a property is declared:
var
testVM= kendo.observable({
UserDefinedCreditCardDS:
function
(e) {
return
ImportPNRCreditcardDS();
},
});