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,
I can add a new row in my grid,but I find an question like picture in attachment when I use cycle to add 5 Rows in grid!
my code:
function WebButton1_Click() {
var grid = ISGetObject("WebGrid1"); for (var i=0;i<5;i++) { var totalRows = grid.TotalRows; var newRow = grid.RootTable.NewRow(); var newCells = newRow.GetCells();
newCells.GetNamedItem("vouid").SetText(totalRows + 1, true); newCells.GetNamedItem("商品编号").SetText("", true); newCells.GetNamedItem("商品名称").SetText("", true); newCells.GetNamedItem("商品规格").SetText("", true); newCells.GetNamedItem("包装单位").SetText("", true); newCells.GetNamedItem("数量").SetText("", true); newCells.GetNamedItem("价格范围").SetText("", true); newCells.GetNamedItem("备注").SetText("", true); newRow.Update(); }}
How can i solve it?
Hi Heny,
I am sorry, but I also could not figure out what is the correct validation for this scenario. As I said before, even though we succeed but the efforts are too big because at default this scenario is not supported right now.
Regards,Handy
Hi Gao Yixin,
Actually, We could not just add multiple rows in there. But based on your code, that is not exception error. That happens because when one row is added, the process has not finished yet.
e.g if WebGrid is still doing one process and has not finished, try to call another FlyPostback request such as refresh, sorting or filtering. It will show that pop up message.
I suggest you to use setTimeOut() method in newRow.Update(). With delaying or specifying a specific time, you can use your code well.
Hi handy,
can you help me to finish code? thank you ! because I used setTimeOut() methord,but also happen this exception!
Regards,
Yixin
Hi Yixin,
E.g in your added row method, you need to specify setTimeOut() with specific time.
setTimeout(function(){AddSomeRows()},600);
thank you for repling,but you methord is not right,the message is also display!
yixin
I am sorry. Based on your code, the timeout also is not working well. The reccurence of "i", got faster than newRow.Update. So, I would like to correct what I said before. You will still need to use TimeOut to delay for each process. But you must not to use recurrence when add "ID". Because, the time is not correct.E.gID=AAAAA1,AAAAA2,AAAAA3. which (1,2,3) used "i" as repetition.It is very hard to get the correct time out and mostly goes wrong. Therefore, when add multiple rows, you must not to use that repetition.You will need to assign manually via button click.e.gID=aaaaaa,bbbbbb,cccccc
However, adding multiple row at a once is not suggested because to get the exact delay time is very hard.
Hi,Handy
Thank you for replying,I want to add next new row when previous new row is complete add in a grid,how can i do ? This question is very important,thank you again!
Hi,
Unfortunately, this scenario could not be done. Even if It can, the efforts are too big. If you ask for my opinion, maybe you can try to check in OnAfterReponse clientside event. You can get if the status is 'add', try to call back your add function again. However, you will need to find the correct validation. Otherwise, it will always recursive. Maybe you can add some flags or something.
thank you for repling,can you give me sample code?
Ok,thank you !
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