Skip navigation
Currently Being Moderated

can't get cfgrid rowcount

Nov 11, 2011 8:55 AM

i'm trying to get the rowcount of a cfgrid on cf9, and if  0 switch a message to user.

i've tried a js attached to the onLoad of the cfgrid, keeps throwing Expected ')' and i don't see where?

 

function getGridData() {

var mygrid = ColdFusion.Grid.getGridObject('cApps');

var mydata = mygrid.getStore();

rowCountVal = mydata.totalLength;

alert(rowCountVal);

}

 

thanks for any help

 
Replies
  • Currently Being Moderated
    Nov 11, 2011 11:58 AM   in reply to ion

    Comment out every line and add them back one at a time until the error occurs.  If it happens with all lines commented out, look at the code that calls it.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 11, 2011 8:05 PM   in reply to ion

    Where is your onload code in your document?  I'm assuming that if its a regular onLoad attribute of an HTML element (e.g. <Body>, then you don't need the "javascript:" prefix.  Otherwise, what happens if you pop an alert box at the top of your getGridData() method and comment out the rest - are you getting the alert box or is the error occuring before the function can even be called?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points