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 have a self referencing grid with 'Load on demand' for loading the child records.
I have a javascript function for OnRowSelect client side event.I am having a SendCustomRequest Call in this function which does a fly postback.The issue is when I click the plus icon of the parent row to get the child this custom request is getting triggered and the childs are not loading ,
Any solution for this to avoid calling 'SendCustomRequest' when I try to expand the parent
?here is my code.
function wgMessages_OnRowSelect(controlId, tblName, rowIndex, rowEl) { var wgMessages = ISGetObject(controlId); var selectedObject = wgMessages.GetSelectedObject(); // return object of type SelectedObject var selectedRowElement = wgGetRootRow(selectedObject.GetRowElement()); if ((selectedRowElement.type == "Record") { wgMessages.SendCustomRequest(); } }
After check your code, it is unavoidable to expand the parent row without invoking SendCustomRequest();. Clicking the plus icon of the parent row, will invoke OnRowSelect client side event of WebGrid; and the “if” statement will return true since the type of the selected row is record.
Please try to put the “SendCustomRequest()” method in another proper client side event (depends on your scenario) or try to modify the “if” statement so that the conditional statement will have different return value.
Hope this helps.
Hi,
Thanks for the update.On which event I can put my SendCustomRequest()” .
My requirement is to show the details of the Row selected on the Right side of the page .
Also what condition I can check If my SendCustomRequest() is on OnRowSelect() event to avoid the trigger on expand of parent?
Arun
Any one can help me in this?
I’m sorry for the late respond.
Please try to change the “if” conditional statement into following.
function wgMessages_OnRowSelect(controlId, tblName, rowIndex, rowEl) { // retrieves WebGrid's object var wgMessages = ISGetObject(controlId); var selectedObject = wgMessages.GetSelectedObject(); // return object of type SelectedObject // get root row element ( needed for ColumnSet scenario ) var selectedRowElement = wgGetRootRow(rowEl); var e = window.event; var clickedObject = e.srcElement.tagName; if (selectedRowElement.type == "Record" && clickedObject != "IMG") wgMessages.SendCustomRequest(); // perform send custom request else hideContent(); return true; }
The plus sign (“+” as the expanded button of self reference parent row) is an image. I modify the conditional “if” statement so that it will returns true only if the selected row is “record” and the clicked object is not “IMG” image tag.
The srcElement returns the element that fired the event. This is an object, and has the same properties as the element. So, if we click on an image, event.srcElement.tagName will return ‘IMG’.
Hope this help.
That worked .
Thanks
Glad to hear the good news.
Should you need further assistance or run into any problems regarding our controls, feel free to post it into our forum. We would be happy to assist you again.
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