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 used this JavaScript part:
function SetGridTitle(gridID,title) { var grid=ISGetObject(gridID); grid.RootTable.Columns[0].GetElement().innerText=title; return true; }
This crashed, because .GetElement() returned null. The problem was that I have several invisible columns in the grid, so I have to use Columns[12] instead. I don't want to hardcode the column number (12) here.
How do I get the column by its name?
I know the function wgGetCellByName, but that seems to be only for a row. I assume there is something similar for the columns. I also don't want to loop over all columns, because I assume there already exists a function for that purpose.
I found the solution myself. The JavaScript function needed is missing somehow in the documentation, but is visible in the runtime / debugging environment. The new code now looks like this:
function SetGridTitle(gridID,title) { var grid=ISGetObject(gridID); var ColNo=grid.RootTable.Columns.GetNamedItem('Column_Name').Position; grid.RootTable.Columns[ColNo].GetElement().innerText=title; return true; }
or even simpler:
function SetGridTitle(gridID,title) { var grid=ISGetObject(gridID); grid.RootTable.Columns.GetNamedItem('Column_Name').GetElement().innerText=title; return true; }
You can get the column by specifying its name in GetNamedItem method.
e.g
var grid=ISGetObject("WebGrid1"); grid.RootTable.Columns.GetNamedItem("NamedColumn");
Hope this what you are looking for.
Regards,Handy
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