iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
In the Webgrid , there is a column of checkbox , and the header of this column is combine the column name with a checkbox . Through executing the following javascript code:
function SelectAllColumn(obj) { var grid = ISGetObject("<%=WG1.ClientID %>"); var index = obj.name.split('_'); var arr = $("#tb_ctl00_ContentPlaceHolder1_WG1_").find("tr").find("input:eq(" + index[0] + ")"); for (i = 0; i < arr.length; i++) { arr[i].checked = obj.checked; } }
when I click the checkbox of the column header , all checkboxs of this column will be selected . But when I execute some operations , for example delete or save , there will be a alert " You donot make any changes!" , and these operations will not be executed .
there is a example in the attach file . when I select the checkbox of the column header , all checkboxs of this column will be selected ,but the icon colors of accepting all changes or canceling all changes in the footer of the webgrid is gray . It indicate there is not any changes!
Anyone can help me ? Thanks !
Hello Xu,
First of all, sorry for the wrong sample that I attached. Yesterday, I have not tried until accepting all changes. So, I also get that issue here. I have provided a solution using this snippet code:
function SelectAll(obj) var grid = ISGetObject("WebGrid2"); for (i = 0; i < grid.TotalLoadedRows; i++) { var row = grid.RootTable.GetRow(i); var cell = row.GetCells()[3]; cell.SetValue(true, true); cell.ActivateEdit(); grid.MarkEdit(); grid.ExitEdit(1, 0, 0); } }
Attached in my simple runable sample. In this sample I also show you how to un-check all checkBox.
Please let me know whether the issue still exist, or if there is another issue.
Thanks.Riendy
Hello Xu,I am able to replicate your issue on my end. I think you should to add 1 line of code to syncdhronize pending changes with grid's user interface elements. Please add this snippet code to your SelectAllColumn method.
grid.UpdatePendingChangesStatus();
You can also add the snippet code above to OnCheckBoxClick WebGrid's clientSide Event to do same response when some checkBox clicked.
Hope this helps.Riendy
Hello Riendy,
Firstly , thanks for your reply and help . I have tried to use the two methods you recommended ,but there is not any changes at all . when I select the checkbox of the column header , all checkboxs of this column will be selected , but the icon colors of accepting all changes or undoing all changes in the footer of the webgrid is gray . I think this indicate I did not make any changes in this webgrid .
In the attachment file , there is a simple example based on the live example of Intersoft Solutions . So can you help me to solve this problem ? I will be very grateful !
Hi Xu,I'm still investigate your issue. I will let you know as soon as possible about this issue. This issue might be a bug.
Anyway, to initialize WebGrid, I suggest you to use ISGetObject. So, you are able to use our method, such as UpdatePendingChangeStatus. For example :
var grid = ISGetObject("WebGrid1");
Regards.Riendy
Hello Riendy ,
Thank you for your help . I want to know whether there is the newest development about the issue I put forward . Because I have to use the function that I have raised in my project , I am looking forward to your respond eagerly .
Thanks a lot !
Hello Xu,Actually there is no bug with your issue. At the beginning I've told you that you have to add UpdatePendingChangesStatus(). I'm sorry because I missed a method to add the pending changes. It is AddPendingChanges() method. I have created the snippet code based on your scenario. Here is the snippet code:
function SelectAll(obj) { var grid = ISGetObject("WebGrid1"); for (i = 0; i < grid.TotalLoadedRows; i++) { grid.RootTable.GetRow(i).GetCells()[0].SetValue(1, true); grid.RootTable.GetRow(i).AddPendingChanges(); grid.UpdatePendingChangesStatus(); } }
I also have modified your simple runable sample to reproduce in WebGrid's sample easilly. Attached is a sample file.
Best Regards.Riendy
Thank you for your reply ! Are you sure the sample file you provided is correct ? I find the sample only have WebComb and ISDataSource , and it is not the same as the sample I have provided .
Besides , I have tried the method you put forward . When I click the checkbox of the header column and select all checkboxs of this column , I click the icon of accepting all changes in the footer of the webgrid , then an unhandled exception occur . It said "To analyse in this string , it must specify effective information" .
Can you give me an integrity sample ? When I click the checkbox of the header column and select all checkboxs of this column , then I can click the buttons of WebToorbar and execute some operations , such as add or delete or save . Then I can do my work referring to your sample .
Thank you very much !
Thank you very much ! The method you provided is right !
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname