I added some fixes to my function and it worked just fine...
This is what i did
...
calling the delete function from the delete button ..
links = "<button type=\"button\" onclick=\"deleteTheme('"+rowId+"','"+name+"')\">Del</button>";
the rowId - will represent the current table tr/row - such that if i delete the value, i should also delete the row.
the Name - represents the theme name i want to delete.
And the delete method...
deleteTheme = function( rowId, value ){
themesHolder.themes.removeValue("name", value );
deleteRow( rowId );
updateThemeBox();
}
Array.prototype.removeValue = function( propertName, value ){
for( var i=0; i<this.length;>
if( this[i].name == value ){
this.splice( i, 1 );
}
}
}