Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the already opened popup in jquery mobile

I googled and search SO but can't find anything relates to me.

http://jsfiddle.net/aravinth/Ad22d/90/

In this fiddle, cloned the table rows using ADD ROW in that table row click Add Expenses shows the popup it is also cloned when click the PLUS icon...

My problem starts here now i click the first row add expense button, 3 rows cloned in popup then click the second row add expenses it shows three rows but i need to show only one column (that is default one)...

Please suggest some idea...Thank You

like image 954
Aravin Avatar asked Feb 19 '14 08:02

Aravin


1 Answers

I have added following method on addExpenses buttons (i.e. Add onclick="addExpenses();" attribute to all addExpenses buttons.)

function addExpenses()
{
  var row = document.getElementById("expenseTable");
  var table = document.getElementById("expenseParticulars");
  var rowcount=table.rows.length-1;
  for(var i=2;i<=rowcount;)
  {
    table.deleteRow(i);
    rowcount--;
  }
  var clone = row.rows[1];
  var addExpenses = clone.cells[3].getElementsByTagName('input')[0];
  addExpenses.disabled = false;
  counter=2;
}

Please refer this jsfiddle.

like image 105
YaSh Avatar answered Oct 19 '22 19:10

YaSh