Hi, Dev Team!
I have two questions:
1. How i can hide "Clear" button?
2.How i can hide annoing ".00" after integer number in NumericTextBox field?
3 Answers, 1 is accepted
Hello Andrey,
The buttons of the Form can be customized through the buttonsTemplate option as follows:
buttonsTemplate: "<button class='k-button'>Submit</button>",
items: [
{ field: "Age", editor: "NumericTextBox", editorOptions: { format: "n0" } }
]
Here is a Dojo example where both of the above options are demonstrated.
I hope this helps.
Regards,
Dimitar
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
Dimitar, thank you!
So for execute code after press button i need to provide ID and bind some action by ID like
buttonsTemplate: "<button class='k-button' id='myButton'>Submit</button>"
document.querySelector("#myButton").onclick = function () {}
Hello Andrey,
In general, when adding a submit button to the form through the template will cause the form to be submitted as usual when this button is clicked. In case you would like to prevent the standard form submit and instead send an ajax request, you can:
1) Proceed as you have already suggested by adding a click handler, calling ev.preventDefault() and then sending an ajax request.
2) Utilize the Form submit event, prevent it, and send an ajax request:
$("#exampleform").kendoForm({
...
buttonsTemplate: "<button id='my-button' class='k-button'>Submit</button>",
submit: function(ev) {
ev.preventDefault();
var model = ev.model;
console.log(model);
// send ajax
}
});
Regards,
Dimitar
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.