Link to home
Start Free TrialLog in
Avatar of bujjigadu
bujjigadu

asked on

how to pass data-bind value into my <href> tag

I'm getting data-bind value from sharepoint list. I want to pass the value to the hyperlink, how do I do that.

My html code looks like this, here I'm looping to bind the rows that I got from sharepoint list. I'm trying to pass field value 'ID' in the hyperlink as you can see below but not sure how I can pass data-bind value inside the hyper tag.... I want something like ="/devsite/Lists/test/DispForm.aspx?ID=" data-bind value here><


<table>
  <tbody data-bind='foreach: $root.test.Rows'>
  <hr>
  <tr>
  <tr>
    <td><b>
      <li><a href="/devsite/Lists/test/DispForm.aspx?ID="><font size = 3>
        <div data-bind='text: Title'></div>
        </font></a></li>
      </b></td>
  </tr>
  <tr>
    <td>
</TABLE>

Open in new window

Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Hi,
could you please explain:
- which SharePoint version and edition?
- How do you get the list data?
- Where will this HTML code run: inside SharePoint / outside in an ASP.NET app ?
- Which Javascript framework do you use for data-binding?

Thanks
Rainer

And a general tip: you should increase the points of your questions - just to attract more people as your questions are very time-consuming to answer and not that many experts will invest their precious time for only 150 points.
Avatar of bujjigadu
bujjigadu

ASKER

I'm using SharePoint 2013. I'm using knockout js to get the details from the sharepoint list.

Once I got the results I'm doing for-each loop in html to do data-bind values. I want to pass one of the data-bind value inside <href> tag..

HTML code is part of the script that I use in cotent editor webpart to render the code snippet.
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok let me try and get back on this...