7 Answers, 1 is accepted
Thank you so much for your help on this. So the reason it's not sorting is that I was pointing the field at an object and then returning the value in a template. As a result, the sort method, which looks at the field not the returned template value, was not working. However, now that I've fixed that I have another issue. The reason that I had to use the template is that the service I'm getting this information from doesn't actually return an element if the field value is null, so I have to check if the object is defined and then return the value property of that object (see below). The only way for sorting to work is to point the field at the value property - field: "attributes['contact.firstname'].value" - but then I get an error in the browser when that field is null since the value property is not defined, SCRIPT5007: Unable to get property 'value' of undefined or null reference. I hope this makes some sense, do you have any ideas on the best way to address this?
title: "First Name",
style: "font-weight: bold"
var textValue = "";
if (typeof(textField) !== "undefined" && textField !== null)
if (textField.value !== null)
textValue = textField.value;
Indeed that is what will happen if on the field in the `attributes['contact.firstname']` chain is null. In this case you should normalize the data structure. This can happen by implementing DataSource.parse function. It will be executed every time the data source is feed with new data.
Here is an proof of concept example for this: http://jsbin.com/OcoHaNU/1/edit
I had a look at the Dojo Demo and made some changes to have prefix to the maskedtext. But on the first load (if there are no match to the masked Text) in this example an empty string , the prefix does not appear until unless clicked on the input. This causes a problem because the input should have the prefix regardless of any event occurring on it.
Is there any way I can have the input populated with the prefix on load if the value has not match in masked text.
I have already responded to you in the private ticket that you have submitted but I will paste my response here as well:
The behaviour of a Kendo UI MaskedTExtbox is such by design when the widget has no value - it shows as a regular text input. The mask is revealed on focus and hidden on blur.
On first load, you could check if the mask has value and se the value to the mask:
*in the context of the grid, you can use the edit event handler
Alternatively, you can provide a placeholder as shown in this how to article:
If you feel tht the mask should always be shown on blur and focus, I would suggest we open a feature request on your behalf. Our Kendo Angular and React widgets already implement this behaviour and I can see how that feels like better UX.
Let me know if you would like that and I can convert this ticket to a public feature request so people can vote or it.