2015-06-12 20 views
0

我在jqgrid中有可編輯的行。雙擊textbox,它將打開一個有textarea的彈出框。JQGrid - 彈出框ok的td標題更改

點擊彈出的OK,我需要textarea值返回到jqgrid行單元格,從雙擊被調用。

單元格的值在title屬性td內。

我試圖改變標題屬性使用rowid,但jqgrid細胞不反映與我的新價值。

tr='#'+top_id; 
$(tr).find('td[aria-describedby="Remarks"]').attr('title','txtremark.value'); 

它還顯示在開發人員工具中檢查元素的值發生了變化。但單元格值不變。

我試圖重新加載grid click事件,onloadcomplete事件grid再次設置title屬性。但問題依然存在。 請指導我。

回答

0
I got an answer of this.. On jqgrid's ondblClickRow event I set a title attribute to popup textbox as below. 

    txtremark.value = $(tr).find('td[aria-describedy="Remarks"]').attr('title'); 

    Then, on Ok button click event i reload jqgrid, 
    and after that on LoadComplete event again I set attribute of title and also set html of title like, 





loadcomplete : function(){ 
     tr ="#" + rowid; 
     $(tr).find('td[aria-describedy="Remarks"]').attr('title',txtremark.value); 
     $(tr).find('td[aria-describedy="Remarks"]').html(txtremark.value); 
     $("divremarks").dialog('close'); 
     }); 


    Its compulsory to set html of td other wise next time you got undefined in popup window.