I am using jqGrid and I want to integrate jQuery datePicker inside. It worked fine until I add showOn: 'button' . However, editing no longer works. I really want to pop up the collector with just the click of a button, because the date is the first cell of my row, and I use inline editing, so every row selection displays the datepixer :-(. If I use the same datepicker parameters outside jqGrid, it works.
Please, help
function loadGrid() { var getUrl = 'Transactions.aspx/GridData/?fundID=' + $('#fundID').val(); var lastSel = ""; jQuery("#list").jqGrid({ url: getUrl, editurl: 'Transactions.aspx/Edit/', datatype: 'json', mtype: 'GET', colNames: ['Date', 'Invested', 'Nb Shares', 'Price'], colModel: [ { name: 'Date', index: 'Date', width: 120, align: 'left', editable: true, editoptions: { size: 10, maxlengh: 10, dataInit: function(element) { $(element).datepicker({ dateFormat: 'dd/mm/yy', constrainInput: false, showOn: 'button', buttonText: '...' }); } } }, { name: 'Invested', index: 'Invested', width: 100, align: 'right', editable: true, edittype: 'text' }, { name: 'NbShares', index: 'NbShares', width: 110, align: 'right', editable: true, edittype: 'text' }, { name: 'UnitValue', index: 'UnitValue', width: 150, align: 'right', editable: true, edittype: 'text'}], onSelectRow: function(id) { if (id && id !== lastSel) { jQuery('#list').restoreRow(lastSel); jQuery('#list').editRow(id, true); lastSel = id; } }, pager: jQuery('#navbar'), viewrecords: true, height: 'auto', caption: 'Transactions detail' }).navGrid('#navbar', { edit: false, add: true, del: true }); jQuery("input[type=text]").css("width", "2em"); jQuery("#navbar table").css("margin", "0"); }