bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

Table disappears when removing rows

I am trying to remove Rows, using...

Apperyio("myTable").find("tr:gt(0)").remove();

I can confirm that all Rows are removed from the DOM (confirmed using Chrome dev tools), except the first row. As desired. However, upon executing the above, the table disappears from the screen. Neither Apperyio("myTable").show() nor Apperyio("myTable").refresh() make the table appear again.

What am I missing?

Thank you for your help in advance.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Table disappears when removing rows

Hello Bahar,

Please find our reply in the email.

Julian Alberto De La Rosa Suncar
Posts: 0
Joined: Mon Jan 27, 2014 4:08 pm

Table disappears when removing rows

If you fill the rows manually , add a pseudo class named "class-list-row
I created a public plugin for you with all these

search for RowAddAndDeleteSample

//Add an id to each row including the first one
var row=$("#YourGridID tr:last");
if(!row.attr("id")){

Code: Select all

 row.attr("id",1); 

}
//Add the pseudo class
if(!row.hasClass("class-list-row")){

Code: Select all

 row.addClass(""class-list-row"); 

}

var rowIdx=parseInt(row.attr("id"));
var newRow=row.clone();
rowIdx++;
newRow.attr("id",(rowIdx));
newRow.insertAfter( row );

newRow.hammer().bind("doubletap",function(){

Code: Select all

 $(this).find(".row-delete-button:first").toggle(); 

});

<!---- THEN THIS FOR THE REMOVAL ---
$(this).closest(".contenedores-list-row").remove();

Return to “Issues”