Annonceindlæg fra SoftwareOne
24. september 2015 - 10:55
#1
var handleAddRow = function(e) { $('input.sortid').each(function(idx) { $(this).val(idx+1); }); var row = $('<div class="row" id="listItem_' + (counter_file + 1) + '" style="margin-bottom:10px;"></div>'); var input = $('<div></div>').append('<div style="display: table; width:100%;"><div id="tablet" style="padding-right:10px; display:table-cell; width:80px"><input class="moveable_list qty" id="qty' + (counter_file + 1) + '" type="text" name="qty' + (counter_file + 1) + '" value="0" style="text-align:center"></div><div id="tablet" style="padding-right:10px; display:table-cell; width:100px"><input class="moveable_list price" id="vol' + (counter_file + 1) + '" type="text" name="vol' + (counter_file + 1) + '" value="gr" style="text-align:right"></div><div id="tablet" style="padding-right:10px; display:table-cell;"><input class="sortid" type="hidden" name="sort' + (counter_file + 1) + '" value="' + (counter_file + 1) + '"><input class="moveable_list product" id="product' + (counter_file + 1) + '" type="text" name="product' + (counter_file + 1) + '" value="Tekst"></div><div class="button blue" style="width:30px;"><img src="/images/menu.png" /></div></div>'); input.appendTo(row); row.appendTo('#list'); $('#product' + (counter_file+1)).autocomplete( { source:data, minLength:2, select: function( event, ui ) { $( '#product' + (counter_file+1)).val( ui.item.label ); $( '#vol' + (counter_file+1)).val( ui.item.actor ); return false; } }).data( "autocomplete" )._renderItem = function( ul, item ) { return $( "<li></li>" ) .data( "item.autocomplete", item ) .append( "<a style='font-size:12px; padding:10px; background-color:#f2f2f2; margin-bottom:2px; border:#f2f2f2 1px solid'>" + item.label + ", " + item.actor + "</a>" ) .appendTo( ul ); }; counter_file++; };