New call-to-action
Results 1 to 3 of 3

Thread: Stretching action buttons

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

    Default Stretching action buttons

    I'm trying to get really fancy with action buttons and I'm in way over my head. I'm trying to combine action buttons with a script supplied by wmz in another message. (Thanks for all your help on the board Wolfgang!)

    Here's what I'm trying to do
    I have a grid with a checkbox column and an action button to filter on the checked rows. I did that first, and it worked.

    Next, I want to add an input field and a button to set the value in the "Status" field in all the selected rows to the value from the input field. (Actually, I'd like that input to be a dropdown, but one step at a time)

    So the layout in the toolbar is
    [Button: Filter Selected] [Input field] [Button: Change Status]

    The JavaScript written by the action buttons genie for the Filter button is
    Code:
     
    {grid.Object}.filterCheckedRows();
    The code for the Change button, loosely adapted from wmz, is
    Code:
     
    var rowcount{grid.Object}._rowsInGrid;
    for(rowis = 1; rowis <= rowcount; rowis++)
    {
    {grid.Object}.setValue('G','STATUS',rowis,$('Grid.ComponentName.STAT_INPUT').value);
    };
    and the code for the input field in the Toolbar template customize property is
    Code:
     
    {ActionButton:FILTERSELECTED}&nbsp;
    <input type="text" id="{Grid.ComponentName}.STAT_INPUT" value="" maxlength="10" class="dborInput" />&nbsp;
    {ActionButton:CHANGESELECTEDSTATUS}
    Firebug reports three errors: The first is
    "missing ; before statement
    onClick: function() { var rowcountLISTINGS_STATUS_GridObj._rowsInGrid;"

    I've tried putting in semicolons in various places, but haven't found the right place yet. Any suggestions? Perhaps if I fix this one, it will solve all three.

    The other two errors are
    LISTINGS_STATUS_GridObj is not defined
    (LISTINGS_STATUS is the name of the grid)
    and
    LISTINGS_STATUS_BUTTONS_CHANGESELECTEDSTATUS is not defined
    (CHANGESELECTEDSTATUS is the name of the second button)

    I'd appreciate any help.
    Thanks,
    Pat
    Pat Bremkamp
    MindKicks Consulting

  2. #2
    Member StephenP's Avatar
    Real Name
    Stephen Pilon
    Join Date
    Apr 2000
    Location
    Front Royal, Virginia
    Posts
    491

    Default Re: Stretching action buttons

    Pat,

    Use this for your change button:

    Code:
    var rowcount = {grid.Object}._rowsInGrid;
    var newfield = $('{Grid.ComponentName}.STAT_INPUT').value;
    for(rowis = 1; rowis <= rowcount; rowis++)
    {
        {grid.Object}.setValue('G','STATUS',rowis,newfield);
    };
    Two errors:
    1. Note the error in the first line: no "=" between variable and value.
    2. In calling the STAT_INPUT value, you didn't have the {} around the Grid.ComponentName
    You'll note that I set a VAR called newfield to hold the value you are changing things to. This keeps you from repeating that step for each iteration of the loop. Not much time lost for a couple passes, but still good practice. And if you have a couple thousand passes, it may be noticed.

    Hope this does it for you.
    Stephen Pilon
    Associate Librarian
    Christendom College

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

    Default Re: Stretching action buttons

    That did it! Thanks, Steve!
    Pat Bremkamp
    MindKicks Consulting

Similar Threads

  1. Action Buttons
    By nlk10010 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 11-04-2010, 08:59 AM
  2. Action Buttons Error
    By NormanRMouton in forum Application Server Version 10 - Web/Browser Applications
    Replies: 3
    Last Post: 10-19-2010, 09:01 AM
  3. Action Buttons (sample)
    By Ken Tjia in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 09-30-2010, 05:16 PM
  4. Advanced buttons, redirection and browser back buttons
    By irwincohen in forum Application Server Version 9 - Web/Browser Applications
    Replies: 0
    Last Post: 01-14-2010, 10:59 AM
  5. linking values when opengin grids using action javascript buttons
    By christappan in forum Application Server Version 10 - Web/Browser Applications
    Replies: 6
    Last Post: 11-17-2009, 01:42 PM

Bookmarks

Posting Permissions

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