My datagrid is based on the popup editing application in this demo:
(Application : Basic Crud)
http://www.jeasyui.com/demo/main/index.php?plugin=Application&theme=default&dir=ltr&pitem=Basic%20CRUDMy popup form includes a combogrid, a text area and 3 number input fields.
When the user makes a selection from the combogrid, using an onSelect event, it looks up two values from the combogrid datasource and autofills them in the popup edit form.
This is the autofill function:
$(document).ready(function(){
$('#iditem_id').combogrid({
onSelect:function(rowIndex, rowData){
$('#idPurchaseRate').val(rowData.PurchaseCost);
$('#idDescription').val(rowData.PurchaseDescription);
}
});
});
onSelect:function(record) didn't work but the above works fine.
HOWEVER
If the target input fields include
class="easyui-numberbox" to give them numberbox functionality
i.e:
<input id="idPurchaseRate" name="PurchaseRate" class="easyui-numberbox" type="text" style="width:80px">
The record saves but does not save the autofill number.
I believe that I need to parse the json datasource so that the receiving numberbox input recognises it as a float decimal number.
Not sure how to achieve this. Can anyone advise?
(I would also be interested to understand when onSelect:function(record) should be used for autofills)
Thank you!