Home Analyst Portal

Get a specific gridItem and its value

Robert_OsterbergRobert_Osterberg Customer Advanced IT Monkey ✭✭✭
So i am working on a custom task that will take a CI item from a grid and use it in a web url. But if i have more than the CI say a Business service for instance i get that item and it`s value. 
So far i have tried this 
var x = pageForm.viewModel.HasRelatedWorkItems[i].DisplayName.toLowerCase(); //gets the item in the grid
var y = $("#HasRelatedWorkItems div div table tbody tr td")[i].innerHTML //gets the value

But how can i loop trough the items in the grid and match/get the one specific that i need to pu in the url
http://sethnn313:81/quicksearch.aspx?q=" + y //insert the variable into the URL

Another approach would be ig you can make the CI item in the grid clickable and get to say the HW asset page of that CI 
but my know how of jquery is somewhat limited.

Thx

Best Answer

Answers

  • Roland_KindRoland_Kind Partner Advanced IT Monkey ✭✭✭

    Hi,

    I am not 100% sure, but I believe, that the viewmodel contains all important values for related items (CI, WI)- what info (value) do you need for your URL ?

    regards

  • Robert_OsterbergRobert_Osterberg Customer Advanced IT Monkey ✭✭✭
    yes i does and i can get the value of the item if it is the only item in the grid but if there is two or more it alwasy selects the first one. So i have to loop trough the items in the grid and select the one i want.
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    It is certainly possible to interrogate the Grid widget for a specific cell value, but the approach above is infinitely easier and just as accurate if not more so.
Sign In or Register to comment.