Hello.
I learn for webix features to use it for developing web interfaces.
I have not found number editors for input decimal numbers with delimiters, such as comma.
I try to add a custom editor for datatable cell:
webix.editors = {
"myeditor":{
focus:function(){
this.getInputNode(this.node).focus();
this.getInputNode(this.node).select();
},
getValue:function(){
return this.getInputNode(this.node).value;
},
setValue:function(value){
this.getInputNode(this.node).value = value;
},
getInputNode:function(){
return this.node.firstChild;
},
render:function(){
return webix.html.create("div",
{
"class":"webix_dt_editor"
},
'<input class="number"/>');
} }
};
And I try to set jquery event handler for editor input:
<script type="text/javascript">
$('input.number').keyup(function(event) {
if(event.which >= 37 && event.which <= 40) return;
$(this).val(function(index, value) {
return value
.replace(/\\D/g, "")
.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ",")
;
});
});
</script>
But jquery event not works Within datatable cell with custom editor. Although jquery handler works for input Not inside webix component.
I need for event handler to return new value in input, that contains comma decimal delimiter.
Can you help me? Thanks.