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 meet a question when I use webgrid . Is there any method to get the sum of the items of webgrid ? Besides , can this sum be displayed in the StatusBar of the footer of webgrid ?
Anyone can help me ? Thank you very much !
Hello,
Nope, You need to calculate the sum operation manually. If you want it to show in the status bar, yes it can. After calculate the value, write it in status bar element. You can search the method in "Switching to new Client Side API" article documentation.
Regards,Handy
Hello Handy ,
Thank you for your help . I want to know what mean "Switching to new Client Side API" is . I do not find the method you said . Can you explain it more ? I will be very grateful !
It depends on your WebGrid structure. You will need to find the correct element. It should be something like this : Table.GetElement(WG40.STATUSBAR,WG40.HTMLDIV).rows[1].cells[...].innerText=...This table is assigned with WebGrid1.RootTable;. GetElement() has two parameters, Value and Description. After you set the parameter for StatusBar, all you need is to find the correct element based on your structure.
Thank you for your reply . I have tried the method you provided , however , when my program execute this command , a javascript error appear . It said "childNodes is null or childNodes is not a object" . I also tried GetElement(WG40.STATUSBAR,WG40.HTMLCELL) , GetElement(WG40.STATUSBAR,WG40.HTMLROW) , GetElement(WG40.STATUSBAR,WG40.HTMLTABLE) . But the error also appeared . The picture in attachment file is the statusbar in my project . Can you help me ? Thanks a lot !
As I said, you would need to get the proper element based on your structure. If those paremeters are not correctly to put, you would need to fill it with another value. You can also send me your simple sample that replicates this structure. I would gladly to help you.
I want to get the sum of the items of webgrid and I want it to show in the status bar in this simple sample . I believe it's easy for you .Really looking forward to your great help .
It seems based on your WebGrid, table is not the correct element. It easier to get it directly from WebGrid element. You can try to find the proper location that you want to place the text for sum of items.
e.g grid.GetElement(WG40.STATUSBAR, WG40.HTMLCELL);This code will let you get the element of "Ready" in status bar. You may able to go to its parentNode or perhaps add new <td> to easier to mantain layout information for your status bar. Hope this helps.
It seems that the way you give me is feasible ,but now I can only obtain the total of current page(look at the lower right corner of picture1).My boss did not agree with this method.My purpose is obtaining the total of all!I think you can make the total of all show in the status bar in my sample and send it back to me,please! Thank you!
I only gave the way to put information in the status bar, not the way to calculate the information of your records. You need to calculate manually the real record. WebGrid could not calculate it because the data has not been loaded yet in other pages. You need to calculate the row in query or something. Then, put the correct value in this footer.
I find the WebGrid can display the total number When I set PagingMode="VirtualLoad" in LayoutSettings . You can see the result from the picture in attachment file . Why ? How the WebGrid get the total number from database ? Did you tell me there is no way to get the total number ??
Besides , When I use IsDataSource , I must write the method of SelectCount in the Bizlogic file . This method return the total number of items of WebGrid . What is the function of this method ?
It is default mechanism only in virtual load. I will let you know how to do it manually in virtual load. There are two properties to set. The total records can be retrieved from database via query command.I hope my sample can guide you.
Thank you very much for your reply and sample . I have known how to set the total number in the StatusBar in the InitalizeDataSource . However , If I use the ISDataSource , how can I get the ReturnValue of SelectCount method . Because the ReturnValue of this method is the total number of WebGrid .
Thanks a lot !
I think you are missing my point. If you already knew how to set it, then you only need to know how to get the total record. I am sure this is the one that you were looking for. My point is, even though you used ISDataSource, you can also use query in server side(.cs) like I did in my sample. Remember, we only need to get that information which it would be ok to leave bind data in .cs.*You can ignore e.datasource... You don't need to do this since you already used ISDataSource.
Thank you for your method . I have used this method to get the total number . However , I hope sincerely you can provide the interface (or the attribute or the method ) to get the total number of WebGrid in the next version . Then we can work more easier .
I would create a work item regarding this request. Our developer would consider to implement this feature in the future. Thank you for your feedback.
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