//here is my method function initializeCheckBox(elementName, dataService, render, name) { if (render === null) render = function(item) { return(item.text); }; var $element = $(elementName); $.when(dataService()).then(function (data) { $element.append($unorderedList); for (var itemIndex in data) { var $input = $('<input type="checkbox" name ="'+name+'" value="' + data[itemIndex].value + '">' + render(data[itemIndex]) + '</input>'); $input.data(data[itemIndex]); $input.appendTo($element); } }); } //changing my method in an ordered list function initializeCheckBox(elementName, dataService, render, name) { if (render === null) render = function(item) { return(item.text); }; var $element = $(elementName); $.when(dataService()).then(function (data) { var $unorderedList = $('ul class="stylebox"'); $element.append($unorderedList); console.log($unorderedList); for (var itemIndex in data) { var $input = $('<input type="checkbox" name ="'+name+'" value="' + data[itemIndex].value + '">' + render(data[itemIndex]) + '</input>'); var $row = $('<li>'); $input.data(data[itemIndex]); $input.appendTo($element); } }); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)