Conversation
|
Thank. What were the bugs that you fixed? |
|
oh, I meant that bugs with the control, it was incorrectly put state. |
|
Yes I understood :) But what kind of bugs did jquery.jeditable.checkbox.js have? |
|
Bugs with correct setting checked attribute. |
|
ok, i'll close the request |
|
Sorry I just have not had time to do this yet. Will check it during the weekend. Reopened. |
|
I don't know if this will be useful - but I needed this at urgent so I made a dirty work around. I just wanted to set a DB field 1 OR 0 with Check or Uncheck of the Checkbox. So here is what I did. First, I displayed it like this if($id->is_top =='1'){
echo "<td class='edit_top' id='".$id->id."'>Yes</td>";
}
else{
echo "<td class='edit_top' id='".$id->id."'>No</td>";
}Then - the checkbox plugin I tweaked is as below. $.editable.addInputType("checkbox", {
element : function(settings, original) {
var input = $('<input type="checkbox" >');
$(this).append(input);
return(input);
},
content : function(string, settings, original) {
var checked = string == "Yes" ? 1 : 0;
var input = $(':input:first', this);
var value = "";
if(checked == 1){
$(input).attr("checked", checked);
$(input).checked = true;
value = '1';
}
else{
value = '0';
$(input).removeAttr('checked');
}
$(input).val(value);
},
submit: function (settings, original) {
var value = "";
var input = $(':input:first', this);
if(input.attr('checked')){
value = '1';
}
else{
value = '0';
}
$("input", this).val(value);
}
});Hope this helps whosoever is in need. Cheers! |
|
Hello, The checkbox has been added to the code. Thanks for your contribution :) |
I fixed this checkbox here svn.appelsiini.net/svn/javascript/trunk/jquery_jeditable_contributed/jquery.jeditable.checkbox.js