jQWidgets Forums
Forum Replies Created
-
Author
-
January 9, 2013 at 2:45 pm in reply to: Problem with Custom ListBox Item Renderer Problem with Custom ListBox Item Renderer #13388
Thanks for your response, Peter. Sadly I need two checkboxes (otherwise trust me, I would take advantage of the built ones). I do like the drag and drop functionality, however. Is the drag and drop widget capable of handling elements with dynamic states, or could I expect similar issues?
January 8, 2013 at 2:55 pm in reply to: Problem with Custom ListBox Item Renderer Problem with Custom ListBox Item Renderer #13299<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Insert title here</title><link href="../jqwidgets/jqwidgets/styles/jqx.base.css" rel="stylesheet" type="text/css"/><script type="text/javascript" src="../jqwidgets/scripts/jquery-1.8.2.min.js"></script><script type="text/javascript" src="../jqwidgets/jqwidgets/jqx-all.js"></script><script type="text/javascript">$(document).ready(function() { var exampleSource = [ 'Item_1', 'Item_2', 'Item_3' ]; $("#jqxListBox").jqxListBox({ source: exampleSource, width: 250, height: 400, allowDrag: true, allowDrop: true, renderer: function (index, label, value) { var table = '<table><tr><td>' + label + '</td><td><input id="' + label + '_check1" type="checkbox"'; if (globalCheckboxes[label].check1) table = table + ' checked="checked"'; table = table + ' onclick="onclick1(\'' + label + '\')"/></td><td><input id="' + label + '_check2" type="checkbox"' if (globalCheckboxes[label].check2) table = table + ' checked="checked"'; table = table + ' onclick="onclick2(\'' + label + '\')"/></td></tr></table>'; return table; } }); });var globalCheckboxes = {Item_1: {check1: true, check2: true}, Item_2: {check1: true, check2: false}, Item_3: {check1: false, check2: false} };function onclick1(label) { globalCheckboxes[label].check1 = !globalCheckboxes[label].check1;}function onclick2(label) { globalCheckboxes[label].check2 = !globalCheckboxes[label].check2;}</script></head><body><div id="jqxListBox"> </div></body></html>
January 8, 2013 at 2:40 pm in reply to: Problem with Custom ListBox Item Renderer Problem with Custom ListBox Item Renderer #13292Sorry, looks like it got cut off. I have attached the script for the example below.
Problem is in IE 7 when you click on a checkbox, and then click on another listbox item, the state of the first checkbox reverts to what it was before.
$(document).ready(function() {
var exampleSource = [
‘Item_1’,
‘Item_2’,
‘Item_3’
];$(“#jqxListBox”).jqxListBox({
source: exampleSource,
width: 250,
height: 400,
allowDrag: true,
allowDrop: true,
renderer: function (index, label, value) {
var table = ” + label +‘
‘;
return table;});
var globalCheckboxes = {Item_1: {check1: true, check2: true},
Item_2: {check1: true, check2: false},
Item_3: {check1: false, check2: false}
};
function onclick1(label) {
globalCheckboxes[label].check1 = !globalCheckboxes[label].check1;
}
function onclick2(label) {
globalCheckboxes[label].check2 = !globalCheckboxes[label].check2;
} -
AuthorPosts