im new here
im new here
Hello there,
just a week ago i started programming jquery, and further else i haven't got that many experience at all.
so this is what i wanna do:
i got the table called 'check_listdata' and im trying to use the drag and drop plugin but nothing seems to work. without this plugin the table comes out fine
My code is like this:
/style>
/* Define two custom functions (asc and desc) for string sorting */
jQuery.fn.dataTableExt.oSort['string-case-asc'] = function (x, y) {
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
};
jQuery.fn.dataTableExt.oSort['string-case-desc'] = function (x, y) {
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
};
$(document).ready(function () {
/* Build the DataTable with third column using our custom sort functions */
$('#check_listdata').dataTable({
"aaSorting": [[0, 'asc'], [1, 'asc']],
"aoColumnDefs": [
{ "sType": 'string-case', "aTargets": [2] }
]
});
$('.default-value').each(function () {
var default_value = this.value;
$(this).css('color', '#666'); // this could be in the style sheet instead
$(this).focus(function () {
if (this.value == default_value) {
this.value = '';
$(this).css('color', '#333');
}
});
$(this).blur(function () {
if (this.value == '') {
$(this).css('color', '#666');
this.value = default_value;
}
});
});
});
my final goal is to make it work like the link below:
http://www.jonathonjoyce.co.uk/2011/04/08/updating-datatables-display-orders-by-drag-and-drop/
I hope someone can help me out please,
greetz,
anony the netherlands
just a week ago i started programming jquery, and further else i haven't got that many experience at all.
so this is what i wanna do:
i got the table called 'check_listdata' and im trying to use the drag and drop plugin but nothing seems to work. without this plugin the table comes out fine
My code is like this:
/style>
/* Define two custom functions (asc and desc) for string sorting */
jQuery.fn.dataTableExt.oSort['string-case-asc'] = function (x, y) {
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
};
jQuery.fn.dataTableExt.oSort['string-case-desc'] = function (x, y) {
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
};
$(document).ready(function () {
/* Build the DataTable with third column using our custom sort functions */
$('#check_listdata').dataTable({
"aaSorting": [[0, 'asc'], [1, 'asc']],
"aoColumnDefs": [
{ "sType": 'string-case', "aTargets": [2] }
]
});
$('.default-value').each(function () {
var default_value = this.value;
$(this).css('color', '#666'); // this could be in the style sheet instead
$(this).focus(function () {
if (this.value == default_value) {
this.value = '';
$(this).css('color', '#333');
}
});
$(this).blur(function () {
if (this.value == '') {
$(this).css('color', '#666');
this.value = default_value;
}
});
});
});
my final goal is to make it work like the link below:
http://www.jonathonjoyce.co.uk/2011/04/08/updating-datatables-display-orders-by-drag-and-drop/
I hope someone can help me out please,
greetz,
anony the netherlands
This discussion has been closed.