Results 1 to 2 of 2

Thread: Listview in JavaScript

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    11

    Talking

    I got this code to work in VBScript, now I'm trying to do it in JavaScript. Can anyone offer any clues as to the syntax? I have no idea and can't find any docs...

    <HTML>

    <SCRIPT LANGUAGE=JavaScript><!--

    function init()
    {
    var itmX;

    document.frmTest.lvwMain.ColumnHeaders.Add (,,"NAME", 150)

    // set itmX = lvwMain.ListItems.Add(1,,"CHANDLER")
    // itmX.SubItems(1) = "6A"
    }

    --></SCRIPT>

    <BODY Name=frmTest OnLoad="Init">

    <OBJECT classid="clsid:BDD1F04B-858B-11D1-B16A-00C0F0283628"
    Name=lvwMain
    Height=400
    width=350>
    <PARAM NAME="View" VALUE="3">
    <PARAM NAME="Checkboxes" VALUE="-1">
    </OBJECT>

    </BODY>

    </HTML>

  2. #2

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    11

    Wink Got it

    Gee, this wasn't as hard as I thought. Gotta watch the semi-colons, too...

    Oddly enough, the syntax was easier than VBScript. The object reference 'lvwMain.ListItems(0).SubItems(1) = "6A";' didn't work in VBScript.

    <HTML>

    <HEAD>

    <SCRIPT LANGUAGE=JavaScript><!--

    function init()
    {
    var itmX;

    lvwMain.ColumnHeaders.Add (1,"NAME","NAME", 150);

    lvwMain.ListItems.Add(1,"CHANDLER","CHANDLER");
    lvwMain.ListItems(0).SubItems(1) = "6A";
    }

    --></SCRIPT>

    </HEAD>

    <BODY Name=frmTest OnLoad="init()">

    <OBJECT classid="clsid:BDD1F04B-858B-11D1-B16A-00C0F0283628"
    ID=lvwMain
    Height=400
    width=350>
    <PARAM NAME="View" VALUE="3">
    <PARAM NAME="Checkboxes" VALUE="-1">
    </OBJECT>

    </BODY>

    </HTML>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width