Checkbox Sorter
Hello,
When one checked one checkbox of five checkbox, than after saved the other four unchecked checkbox are removed and the checked checkbox has no checked attribute. When one save against, than are the before saved options remove and all five checkbox displayed and the before saved options are not more saved for the checkbox sorter.
Here a picture of the normal:

Then after checked the first two and saved:

And here is the problem. One cannot set defaults and this two are not checked.
After i uptaded a other option, then looks like the first picture. The sort is reset and all are displayed again.
Can you make that one can set default and checked attribute, and that the not checked are not removed.
Whew. You're right. That wasn't my code. Looks to be a bit of a mess. Have to fix it. On it.
Oy, to get the checkboxes to save will require hidden elements added and removed by javascript. Oy.
Can you tell me why/where the array are removed from the unchecked checkboxes? I have make this, but this is the last problem that the unchecked elements are removed and i search in the code but found yet nothing. thanks
I'm trying to work around it. The issue is checkboxes if not checked don't post to the form. So I'm using javascript to append hidden elements when needed. It's a bit of a pain, heh.
In smof framework they use something like that, so that the unchecked checkboxes also within a array. Checked with a 1 and unchecked with a 0.
$('#of_form :input[type=checkbox]').each(function() {
if (!this.checked) {
serializedReturn += '&'+this.name+'=0';
}
});
/** AJAX Save Options */
$('#of_save').live('click',function() {
var nonce = $('#security').val();
$('.ajax-loading-img').fadeIn();
//get serialized data from all our option fields
var serializedReturn = $('#of_form :input[name][name!="security"][name!="of_reset"]').serialize();
$('#of_form :input[type=checkbox]').each(function() {
if (!this.checked) {
serializedReturn += '&'+this.name+'=0';
}
});
var data = {
type: 'save',
action: 'of_ajax_post_action',
security: nonce,
data: serializedReturn
};
$.post(ajaxurl, data, function(response) {
var success = $('#of-popup-save');
var fail = $('#of-popup-fail');
var loading = $('.ajax-loading-img');
loading.fadeOut();
if (response==1) {
success.fadeIn();
} else {
fail.fadeIn();
}
window.setTimeout(function(){
success.fadeOut();
fail.fadeOut();
}, 2000);
});
return false;
});
Resolved in a much simpler way in b75778a. Re-open if the problem persists.
I tested and it works. Thanks. Also you shoud changed the css for the sortable checkbox, so that all drag icons are on the equal place.

i added a min-width: 100px; for the label.
@Abu-Taymiyyah Made this change. I think you'll be satisfied with how it looks now.
@Abu-Taymiyyah You may want to see this: https://github.com/ReduxFramework/redux-converter