Page 1 of 1

Table disappears when removing rows

Posted: Sun Jan 10, 2016 9:27 pm
by bahar.wadia

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.


Table disappears when removing rows

Posted: Mon Jan 11, 2016 7:27 am
by Evgene Karachevtsev

Hello Bahar,

Please find our reply in the email.


Table disappears when removing rows

Posted: Sun Jan 17, 2016 12:00 am
by Julian Alberto De La Rosa Suncar

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();