Hello,
I have kendo grid in mvvm.
<
script
id
=
"TSTSettlementTemplate"
type
=
"text/x-kendo-template"
>
<
div
data-bind
=
"visible: isSettlementGridVisible"
class
=
"test67"
>
<
div
data-role
=
"grid"
id
=
"SettlementGrid"
data-editable
=
"true"
data-toolbar='[{"template": "<div class=\"toolbar\"><
input
type=\"button\" class=\"k-button k-button-icontext\" onclick=\"AddSettlementrow(this)\" value=\"+ Add New Record\"/></
div
>" }]'
data-columns="[
{ 'field': 'Entity', 'title': 'Entity', 'width': 110 ,editor: SettlementGridEntityEditor , template: kendo.template($('\\#SettlementEntityDisplay').html()) },
{ 'field': 'Entity', 'title': 'Entity Type', 'width': 50 , editable: false, editor: nonEditorforEntityTypeDisplay, template: kendo.template($('\\#SettlementEntityTypeDisplay').html()) },
{ 'field': 'Payer', 'title': 'Payer', 'width': 110 ,editor: SettlementGridPayerEditor , template: kendo.template($('\\#SettlementPayerDisplay').html()) },
{ 'field': 'SettlementType', 'title': 'Settlement Type', 'width': 110 ,editor: SettlementTypeEntityEditor , template: kendo.template($('\\#SettlementTypeDisplay').html()) },
{ 'field': 'PaymentMode', 'title': 'Payment Mode', 'width': 150 ,editor: SettlementGridPaymentModeEditor , template: kendo.template($('\\#SettlementPaymentModeDisplay').html()) },
{ 'field': 'PaidUsing', 'title': 'Paid Using', 'width': 150 ,editor: SettlementGridPaidUsingEditor , template: kendo.template($('\\#SettlementGridCreditCardTemplate').html()) },
{ 'field': 'Amount', 'title': 'Amount', 'width': 150 ,editor: SettlementGridAmountEditor },
{ 'field': 'remark', 'title': 'Remark', 'width': 150 ,editor: SettlementGridRemarkEditor },
{ text: 'Select', title: 'Action', template: kendo.template($('\\#SettlementGridOperationTemplate').html()) , 'width': 110}
]"
data-bind="source: settlementgridDS"
style="height: 200px"></
div
>
</
div
>
</
script
>
By javascript i programatically set DataSource as below code before binding object to above template :
SettlementVm.Data.settlementgridDS =
new
kendo.data.DataSource({
data: data.PricingSettlements,
schema: {
model: {
id:
"ID"
,
fields: {
ID: { type:
"number"
, editable:
false
, nullable:
true
}
//Entity: { type: "string", validation: { required: true } },
//Payer: { type: "string", validation: { required: true } },
//SettlementType: { type: "string", validation: { required: true } },
//PaymentMode: { type: "string", validation: { required: true } },
//PaidUsing: { type: "string" },
//Amount: { type: "number", validation: { required: true } },
//PCCCode: { type: "string", validation: { required: true } },
//Remark: { type: "string", validation: { required: true } }
}
}
}
});
Amount, Remark are simple values rest other columns are complex types.
Problem: When i add new record in kendo grid / or there is existing pre-filled data and when i validate using kendo-Validator it shows no error even if values are not bound. Unless i open edit mode and click on anywhere . Kendo Validator only works when i activate Editor template.
Question:
1) Can i change In-cell Edit mode to full Grid Edit mode?
2) How to validate columns values if Editor template not called ( user doesnt click on in-cell to open edit mode) ?