Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Lost edit confirmation save button difficult to style

    Hi,
    The lost edit confirmation in the ListGrid uses this code to create the ok, cancel and save button:

    buttons:[isc.Dialog.OK,
    {title:this.discardEditsSaveButtonTitle, width:75,
    click:"this.hide();this.topElement.returnValue('save');"},
    isc.Dialog.CANCEL]

    The direct object for the save button makes it difficult to style that button. I solved it through a hack now (replacing the isc.confirm function). Is this something which can be changed somehow in the Isomorphic code? (or maybe I miss another official way of styling this button).

    gr. Martin

    #2
    The recommended approach would be to replace the buttons array entirely (the button definitions are pretty trivial).

    Comment


      #3
      Okay, I thought about this and overriding this method of the ListGrid:
      showLostEditsConfirmation

      but it has this internally (which uses members which are obfuscated at runtime):
      this._continueCallback = continueCallback;
      this._cancelCallback = cancelCallback;

      This means that it is kind of difficult to replace the standard lost edits confirmation with your own implementation with a different button set.

      Or are there other ways?

      gr. Martin

      Comment


        #4
        Sorry, thought that was an AutoChild, but actually it's just an isc.confirm() call.

        What are you trying to do - style this particular Dialog only? That seems like a strange request relative to the alternative of styling the system-wide confirm dialog.

        Comment


          #5
          Indeed I would like to just style the buttons in the dialog globally, now I have code like this to do this:
          isc.Dialog.OK.buttonConstructor = isc.OBFormButton;
          isc.Dialog.OK.baseStyle = 'OBFormButton';
          isc.Dialog.OK.titleStyle = 'OBFormButtonTitle';

          is there a better/nicer way to do this?

          In the case of the lost edit confirmation dialog I can not do this like this because the save button is created separately.

          gr. Martin
          Last edited by martintaal; 2 Feb 2011, 13:12.

          Comment


            #6
            The more correct way to do that is:

            Code:
            isc.Dialog.changeDefaults("OK", {
                 buttonConstructor:"isc.OBFormButton", 
                 ...
            });
            This gives the framework a point of control to customize how styling is applied.

            If you're trying to customize all the buttons in the Dialog's toolbar, the toolbar is an AutoChild (named "toolbar") so you can customize them via toolbarDefaults.buttonConstructor (this wasn't obvious in the docs, but it is now).

            Comment

            Working...
            X