在可编辑中应用类时,将出现datepicker,并且选定的值将显示在文本框中。但是脚本form.submit在editable.js
中不起作用jeditable中的脚本如下:
$.editable = {
types: {
defaults: {
element : function(settings, original) {
var input = $('<input type="hidden"></input>');
$(this).append(input);
return(input);
},
text: {
element : function(settings, original) {
var input = $('<input />');
if (settings.width != 'none') { input.attr('width', settings.width); }
if (settings.height != 'none') { input.attr('height', settings.height); }
if (settings.style != 'none') { input.attr('style', "width:100%;border:1px solid #ccc;"); }
input.attr('autocomplete','off');
if ( typeof settings.class !== 'undefined' && settings.class == 'datePickClass' ) {
input.attr('class','datePickClass');
$(input).datetimepicker({
datepicker:true,
format:'Y-m-d H:i:s',
step:5
});
}
$(this).append(input);
return(input);
}
},
addInputType: function(name, input) {
$.editable.types[name] = input;
}
};
在js文件中:
$(".dateEdit").editable(apiUrl, {
indicator : "<img src='images/close-icon-one.png'>",
tooltip : "",
functionName : "updateEachField" ,
table : "audits",
token : accessToken,
userId : loggedInUser,
conditionField : 'audit_id',
class:'datePickClass'
});