Hello,
sorry, i start now a new thread, mybe is interested for other users too.
i would like add a <option> list (loaded by ajax) to a colum3 if i edit colum1
this works fine if i use only <input> field, but now i would like add a complete new <option> list
Please look my code
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
{name:'roomNr',index:'roomNr', width:30, sorttype:"int", edittype:"select", editable: true, editoptions:{dataUrl:'incl/getData/getRoomData.php?data=tableSectionRoomNr', dataEvents: [{ type: 'change', fn: function(e) { var selected = $(this).find('option:selected'); var selectedRowId = $(grid_selector).jqGrid ('getGridParam', 'selrow'); var extra = selected.data('type'); $('input#roomType').val(extra); } }]}}, // this works fine if i change the roomNr, then add a new roomType to colum-roomType {name:'roomType',index:'roomType', width:65,editable: true}, // now i work with this option.... i get there a <option>field from a ajax-call... but i would like change this... the nlContainerTypeName is depend on the roomNr... if i change the roomNr,,, then i need a special option-field depend on roomnr {name:'nlContainerTypeName',index:'nlContainerTypeName', width:150, sorttype:"text",edittype:"select", editable: true, editoptions:{dataUrl:'incl/getData/getNlContainerTypeName.php?func=Name'}, cellattr: function (rowId, val, rawObject, cm, rdata) { //alert(showProps(rawObject,'test')); return 'class="my-tooltip-test tooltip-warning" data-rel="tooltip" data-toggle="tooltip-warning" data-placement="bottom"'; } }, |
i am not sure, if is possible to add this in the dataEvent
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
{name:'roomNr',index:'roomNr', width:30, sorttype:"int", edittype:"select", editable: true, editoptions:{dataUrl:'incl/getData/getRoomData.php?data=tableSectionRoomNr', dataEvents: [{ type: 'change', fn: function(e) { var selected = $(this).find('option:selected'); var selectedRowId = $(grid_selector).jqGrid ('getGridParam', 'selrow'); var extra = selected.data('type'); var roomId = selected.data('roomId'); $('input#roomType').val(extra); $.ajax({ type: 'POST', url: 'get_option_select_depend_on_selected_room_nr.php?roomId='+roomId, async: false, success: (function(result) { var myObject = myResult[0]; ???? //now add the complete html-code to nlContainerTypeName :) }) }); } }]}}, {name:'roomType',index:'roomType', width:65,editable: true}, {name:'nlContainerTypeName',index:'nlContainerTypeName', width:150, sorttype:"text",edittype:"select", editable: true, cellattr: function (rowId, val, rawObject, cm, rdata) { //alert(showProps(rawObject,'test')); return 'class="my-tooltip-test tooltip-warning" data-rel="tooltip" data-toggle="tooltip-warning" data-placement="bottom"'; } }, |
Thanks for any help
best regards
Achim
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top