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

Thread: What is the javascript property to set the grid to not dirty?

  1. #1
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default What is the javascript property to set the grid to not dirty?

    I have a grid that uses an unbound text field.
    OnChange - this textfield will do an ajax callback to update some things in the backend.

    The submit button on this grid is hidden.

    If i change a quantity in the grid (the aforementioned textbox) and then try to change pages I get the 'You must save or cancel your changes textbox'.
    What I want to do is something like

    myAjaxCB="{grid.Object}.setDirty(false);"

    Is there any documentation anywhere about the grid javascript properties and methods?
    Ive tried searching everywhere.
    Scott Moniz - Computer Programmer/Analyst
    REA Inc.
    http://reainc.net
    (416)-533-3777
    scott@reainc.net

    REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
    If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
    contact us to discuss options.

  2. #2
    Member
    Real Name
    Gráinne
    Join Date
    Feb 2011
    Location
    Germany
    Posts
    174

    Default Re: What is the javascript property to set the grid to not dirty?

    hi Scott,

    did you find a solution? I would need this as well.
    Code:
    {Grid.object}._isDirty= false
    does not work. I would actually need it for a dialog {dialog.Object} but I guess it works the same way.
    Thanks!

  3. #3
    Member
    Real Name
    Gráinne
    Join Date
    Feb 2011
    Location
    Germany
    Posts
    174

    Default Re: What is the javascript property to set the grid to not dirty?

    Does nobody know the anser for this?

  4. #4
    Volunteer Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,646

    Default Re: What is the javascript property to set the grid to not dirty?

    I think ya'll need this:

    {grid.Object}._resetGridPartWithoutConfirmation()
    -Steve


  5. #5
    Member
    Real Name
    Gráinne
    Join Date
    Feb 2011
    Location
    Germany
    Posts
    174

    Default Re: What is the javascript property to set the grid to not dirty?

    Hi Steve,

    Thank you for reply. This does not work for me as I have a {dialog.Object}. There is a {dialog.Object}.resetForm(false); which resets all the field to it original value. But that is not what I want to do. I want to make sure that after I populated the dialog via JavaScript. These field values are not recognized as dirty. And when the user clicks on submit, the values populated by JS should be seen under e.oldDataSubmitted.

    Thank you for your help.

  6. #6
    Member
    Real Name
    Gráinne
    Join Date
    Feb 2011
    Location
    Germany
    Posts
    174

    Default Re: What is the javascript property to set the grid to not dirty?

    Hi All,

    For every one who was following this thread:
    Selwyn gave me a solution in the Thread:http://msgboard.alphasoftware.com/al...613#post595613

    Quote Originally Posted by Selwyn Rabins View Post
    if you look at the javascript generated when you use the server side actions to populate the dialog with data, you will see that the code that gets executed on the client side uses the .populate() method to set the values of controls on the dialog. you will also see the .populate() method discussed if you define an custom ajax callback and you ask a5 to generate the function prototype. the function prototype discusses the .populate() method in the comments.

    so, if you wan to set the value in controls and have these values become the new values for the the dialog's 'original' values, you could use code like this:




    var _d = {};
    _d.ALPHA = 'this is alpha';
    _d.BETA = 'this is beta';
    {dialog.object}.populate(_d);
    {dialog.object}.refreshClientSideComputations();


    this code sets the value of two controls, alpha and beta

    another form of the syntax (javascript syntax, not a5 syntax) would be:


    var _d = {};
    _d['ALPHA'] = 'this is alpha';
    _d['BETA'] = 'this is beta';
    {dialog.object}.populate(_d);
    {dialog.object}.refreshClientSideComputations();

    after the .populate() method the dialog is now 'clean' and the values that were set are the new 'original values' of the dialog. (so if you clicked the dialog reset button after making additional edits, the dialog would return to these values).

    .populate() has some optional parameters to control if the dialog is set to clean after populating, and if the onChange events on the controls should fire when their value is set.

    for example:

    var _d = {};
    _d.ALPHA = 'this is alpha';
    _d.BETA = 'this is beta';
    {dialog.object}.populate(_d,1,flagSetDialogClean,flagFireChangeEvents);
    {dialog.object}.refreshClientSideComputations();
    http://msgboard.alphasoftware.com/al...613#post595613

Similar Threads

  1. Action JavaScript not available in Grid Javascript function declarations
    By Clipper87 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 09-23-2010, 10:22 AM
  2. Using Javascript to set focus in Grid Detail View
    By boba in forum Application Server Version 10 - Web/Browser Applications
    Replies: 3
    Last Post: 08-24-2010, 05:48 PM
  3. How do I set focus in Property Grid Style Xdialog
    By David Montgomery in forum Alpha Five Version 9 - Desktop Applications
    Replies: 2
    Last Post: 04-05-2009, 05:50 PM
  4. Set font within xdialog property grid?
    By Peter.Greulich in forum Alpha Five Version 8
    Replies: 8
    Last Post: 02-23-2009, 08:43 PM
  5. Form "Dirty" property?
    By dodgebros in forum Alpha Five Version 7
    Replies: 10
    Last Post: 10-24-2007, 11:51 AM

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
  •