Example
Source
Run as server control
DbNetList
can be added to any web page as a client-side object with just a few lines of code.
Show Selected
Include the Javascript library file
<script src="../dbnetlist.js"></script>
Client-side script
var dbnetlist1 window.onload = initialise ////////////////////////////////////////////////////////////////////////////////////////////// function initialise() ////////////////////////////////////////////////////////////////////////////////////////////// { dbnetlist1 = new DbNetList( "dbnetlist1" ) with (dbnetlist1) { connectionString = "samples" addTier("select companyname, customerid from customers order by companyname") loadData(false) } } /////////////////////////////////////////////////////////////////////////// function showSelectedRow() /////////////////////////////////////////////////////////////////////////// { var customerID = dbnetlist1.rowValue("customerid") if ( customerID == null ) alert("No row selected") else alert( customerID + " (" + dbnetlist1.rowValue("companyname") + ")" ) }
HTML
<table> <tr> <td> <DIV id=dbnetlist1 STYLE="width:250px;height:200px;"></DIV> </td> <td style="vertical-align:bottom;"> <button onclick=showSelectedRow()>Show Selected</button> </td> </tr> </table>