Announcement

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

    Dynamically filter element in ComboBoxItem

    Hi,
    I have a form with ComboBoxItem that take data form local datasource with local valueMap.

    I want fitler dynamically the record showed on ComboBoxItem.
    I see this is possible overriding pickListCriteria function in ComboBoxItem item.

    What i want to do is dinamically override pickListCriteria returning dynamic criteria (for example placing a ComboBoxItem in a form into a modal window and filtering ComboBoxItem depending on button that open this window, to limit user choice).

    I try this:
    Code:
    messageWindowForm.getItem("type").pickListCriteria  = function(){
     return {id:1}
    }
    without success!

    Can you give me some help, please?

    Thanks.

    #2
    Incorrect usage, see the DataBound Dependent Selects examples.

    Comment


      #3
      Thaks for the suggestionm, I see DataBound Dependent Selects, but this not match with my case.
      In DataBound Dependent Selects the ComboBoxItem is coupled with other item/events in it's declaration, I need to modify behaviour of pickListCriteria at runtime to set criteria for ComboBoxItem.

      Comment


        #4
        You're still confused. pickListCriteria is not a method, it's a property. getPickListFilterCriteria() is the method override point you're looking for.

        Comment


          #5
          I change my implementation as you suggest:
          Code:
              	messageWindowForm.getItem("type").getPickListFilterCriteria = function(){
              		var criteria = {id:"1"};    	
              		return criteria;
              	};
                  messageWindowForm.getItem("type").fetchData();
          but the criteria is not applied yet.
          What wrong?

          Comment


            #6
            Ok, now works:

            Code:
            messageWindowForm.getItem("type").getPickListFilterCriteria = function(){
                		var criteria = {id:["2"]};    	
                		return criteria;
                	};
            Thanks!

            Comment

            Working...
            X