Get a Jumpstart with our Sample Apps
Results 1 to 3 of 3

Thread: Getting count of rows in list after using populate

  1. #1
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,536

    Default Getting count of rows in list after using populate

    The typical way I've gotten the number of rows in a list control to display like in a grid is to create a static text control above the list such as
    &nbsp;<span id="{dialog.componentname}.JOBLIST.RECORDCOUNT"></span>&nbsp;Projects Listed

    However, when populating the list using an sql statement like below in a callback, this doesn't change
    if cnx.execute(sql,args)
    crs = cnx.ResultSet
    json = crs.ToJSONObjectSyntax()
    json = strtran(json,crlf(),"," + crlf())
    json = "[" + rtrim(json,",") + "]"
    js = "var lObj={dialog.object}.getControl('JOBLIST');"+crlf()
    js = js+"var _data="+json+crlf()
    js = js+"lObj.populate(_data);"
    cnx.FreeResult()


    This method allows the user to select, for example, all the projects for a person or all active projects or all completed projects using a simple dropdown box, which is great for us, but the static text does not change.

    Any list experts that can give me a solution?
    Pat Bremkamp
    MindKicks Consulting

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,192

    Default Re: Getting count of rows in list after using populate

    You could put this into the List Control onListDraw event...

    Code:
    $("{dialog.componentname}.JOBLIST.RECORDCOUNT").innerHTML = data.length;

  3. #3
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,536

    Default Re: Getting count of rows in list after using populate

    Perfect. Thanks David.
    Pat Bremkamp
    MindKicks Consulting

Similar Threads

  1. List Control VISIBLE count? Used when a list has some rows hidden.
    By CarlMPearson in forum Mobile & Browser Applications
    Replies: 1
    Last Post: 10-21-2014, 09:56 PM
  2. how to calculate the row count (No of rows) in list.
    By PaulAmmoun in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 07-29-2014, 04:15 PM
  3. Count repeating rows
    By J.R. Noe in forum Application Server Version 11 - Web/Browser Applications
    Replies: 3
    Last Post: 04-20-2012, 01:41 AM
  4. Count Browser Rows?
    By daverad1 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 11
    Last Post: 10-20-2009, 04:36 PM
  5. Count rows in a browse
    By tlyon in forum Alpha Five Version 4
    Replies: 10
    Last Post: 11-24-2001, 10:46 AM

Posting Permissions

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