Announcement

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

    Questions about Hilites

    Version 8.3

    Hi I have a couple of questions about the hilites options for a ListGrid.

    1) How can I disable the "Add Advanced Rule" option?

    2) How can I limit the number of rules the user can configure?

    Thanks

    #2
    Neither is currently possible.

    Why do this, by the way? Seems like extra effort in order to limit the feature.

    Comment


      #3
      We are using the hilites interface to do some configuration on our system but they are not being used the way it was built to. Our system get the hilites configuration saved and use that to show on other part of the system some information using that hilite configuration without using smart client.

      So to be able to read the hilite configurations we need to limit its features.

      I think I'll need to edit the SmartClient code here to be able to remove the "advanced rule" button, can you tell me if this is going to be easy?

      Comment


        #4
        Actually hiding the advanced rule button system-wide is possible, using the standard AutoChild subsystem.
        You can simply do:

        Code:
        isc.HiliteEditor.addProperties({showAddAdvancedRuleButton:false});
        Let us know if that won't cover it for you.
        Regards
        Isomorphic Software

        Comment


          #5
          Thanks it worked just fine!

          While testing I realized that when you try to configure a hilite but doesn't input a value, the save button don't work (it shouldn't, so it's ok) but there is no error message or warning showing that the hilite wasn't saved because you didn't input a value.

          How can I cofigure an warning or message for this kind of error?
          Last edited by ueng; 6 Jun 2013, 05:06.

          Comment


            #6
            Could you be more specific - what do you mean by a "threshold"? Is this part of one of your highlight rules? Which operator?

            Comment


              #7
              Sorry, I got confused with the terms we are using in our system. I edited the previous post, where I said threshold just read hilite.

              Comment


                #8
                OK. At the moment there is no way to stop the user and inform them that they entered an incomplete hilite definition. At the moment, we don't think this is something that should be changed - it's not a situation where the user clearly did something unintentional.

                Comment


                  #9
                  Well the user can forget to add a value there and the save won't work, and the UI don't tell him why. There are inumerous reasons for the user to forget to put a value, this is an issue to the user experience.

                  How can I add some handler for this kind of error? Is there a property that I can add to do so?

                  Comment


                    #10
                    Hi Ueng,
                    We have made some changes to make this behavior customizeable.
                    Please try the next (June 12) nightly build on 8.3 or 9.0 branches.
                    The default behavior is unchanged, but you can use the autoChild pattern to modify the saveButton properties as follows:
                    Code:
                    isc.HiliteEditor.changeDefaults("saveButtonProperties", {
                        click : function () {
                            // `this.creator' is the HiliteEditor instance.
                            var hilites = this.creator.getHilites();
                            if (hilites == null || hilites.length == 0) {
                                isc.warn("No hilites have been configured.");
                                return;
                            }
                    
                            var incompleteHilite = hilites.find("criteria", null);
                            if (incompleteHilite == null) {
                                // Use the standard Save button action.
                                this.creator.saveHilites();
                            } else {
                                var field = ds.getField(incompleteHilite.fieldName);
                                isc.warn("The criterion for '" + (field.title || field.name) + "' is missing a value.");
                            }
                        }
                    });
                    Obviously your app-level implementation may differ from this, but this will warn if there are no valid hilites, or if any specified hilites have no criteria (IE will be applied to all values)

                    Regards
                    Isomorphic Software

                    Comment


                      #11
                      That's what I needed, thanks!

                      Comment

                      Working...
                      X