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
I want to like attach file. when user click checkbox of head, checkbox of column will all check/uncheck and "工号"+“英文名”column value show in textbox.
how to accomplish with client event ?
thank you
Hi Spring gao,
You could use the following Javascript code to accomplish it. (run it when your button click).
function getCheckedValues(){ // get WebGrid with ID. in this example I use WebGrid1 var grd = wgGetGridById("WebGrid1"); var table = grd.GetRootTable(); //this is the point. get all checked row of your grid. var checkedRows = table.GetCheckedRows(); var result = ""; for (var i = 0; i < checkedRows.length; i++) { // append the needed value to result. in this example I use value in column index 3 and index 4. result += checkedRows[i].cells[3].innerText +"|"+ checkedRows[i].cells[4].innerText; result += ","; } // remove leading separator (,) result = result.replace(/,$/, ""); // pass all to textarea/input for showing the result. In this example I used textarea tag with id:"textarea" document.getElementById("textarea").value = result; }
That should do the trick.
first,Thank you leo chandra, but i don't know user click checkbox of head,it's keypoint.how to know?
Sorry for my late response.
If you want that script to run whenever checkbox (on checker column) was clicked, you could add OnCheckBoxClick client event which could be access via WebGrid Properties >> LayoutSettings >> ClientSideEvents >> OnCheckBoxClick. Specify JavaScript that you want to run there.
The result reflected on ASP code side would be something like bellow
<LayoutSettings><ClientSideEvents OnCheckBoxClick="getCheckedValues()"/></LayoutSettings>
Hope this will be useful.
Best Regards,Leo
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