Question

Guys can you help me get through this, because I am making a program that if the user will drag the product in the cart it will show how many hours what they want to rent a (drop-down list from 1-10hrs)

Here's the link what Im working on.

(http://jsfiddle.net/youmarky/fmM3e/)!

function addProduct(name,price){
function add(){
    for(var i=0; i<data.total; i++){
        var row = data.rows[i];
        if (row.name == name){
            row.quantity += 1;
            return;
        }
    }
    data.total += 1;
    data.rows.push({
        name:name,
        quantity:1,
        price:price
    });
}
add();
totalCost += price;
$('#cartcontent').datagrid('loadData', data);
$('div.cart .total').html('Total: ₱ '+totalCost);
}
Was it helpful?

Solution

you need to aad drop down while adding row in table

js fiddle

var h = "<select><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option></select>";
            $('.datagrid-btable tr:last td:eq(1)').html(h);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top