0

I'm trying to use the numeric textbox from kendo, in Angular, inside a kendo grid. Binding the data with my angular object doesn't work. I tried to put an "editor" field in the columns object, or even to do it with a jQuery command (which I know is bad)like this:

$('.editable').kendoNumericTextBox()

but it never works..

1 Answer 1

1

Instead of using the template in the columns object, use the editor attribute:

{
    field: "fieldName",
    title: "Field Title",
    width: "90px",
    editor: numberEditor
}

The numberEditor is a function which you can implement as following:

function numberEditor(container, options) {
  $('<input name="' + options.field + '"/>')
  .appendTo(container)
  .kendoNumericTextBox({
    decimals: 0,   // Settings for the editor, e.g. no decimals
    step    : 1,   // Defines how the up/down arrows change the value
    min     : 0    // You can also define min/max values
});

}

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I tried this, but when I do this I loose the binding on my angular object. My angular object is a bit complicated, and I can't access the value through options.field directly. I found my solution by using schema and type="number"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.