From cd7d62998d46968eb362a50cb763cb41df7751f4 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 1 Apr 2011 02:19:05 +0200 Subject: [PATCH] Fixes bug #556: Updating elements on page >1 error The element tr is now retrieved from the whole pool of elements in the datatable, not just from the visible ones. Also, pagination is not resetted anymore when updating a single element. --- src/sunstone/public/js/sunstone-util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index 919e14afe0..6e847130be 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -143,9 +143,10 @@ function updateView(item_list,data_table){ //replaces an element with id 'tag' in a dataTable with a new one function updateSingleElement(element,data_table,tag){ - var tr = $(tag).parents('tr')[0]; + var nodes = data_table.fnGetNodes(); + var tr = $(tag,nodes).parents('tr')[0]; var position = data_table.fnGetPosition(tr); - data_table.fnUpdate(element,position,0); + data_table.fnUpdate(element,position,0,false); $('input',data_table).trigger("change"); }