Ever had scenario where you use a dojo.query to get the list of elements with some specific class but then realized you need to ignore few more elements from the result but cannot as those elements also have the same class defined.
No problem you can modify your query string to add the not function and pass in the new unique class which only these controls have. Not able to find any unique class, no issues, you can manually assign one custom class and use it in the query.
I encountered this requirement while working in IBM BPM Coaches but this is not specific to BPM instead it's a pattern for dojo query.
So here is an example of filtering the controls using the class names in the dojo.query
dojo.query(".CPP") gives me the list of all the interactive controls in the page. But I don't want the button controls and my button control has another class as "Button" to my modified query will be
dojo.query(".CPP:not(.Button)")
This query will list all the elements with CPP class and exlude those which has CPP & Button class together.
Cheers, Saroj
No problem you can modify your query string to add the not function and pass in the new unique class which only these controls have. Not able to find any unique class, no issues, you can manually assign one custom class and use it in the query.
I encountered this requirement while working in IBM BPM Coaches but this is not specific to BPM instead it's a pattern for dojo query.
So here is an example of filtering the controls using the class names in the dojo.query
dojo.query(".CPP") gives me the list of all the interactive controls in the page. But I don't want the button controls and my button control has another class as "Button" to my modified query will be
dojo.query(".CPP:not(.Button)")
This query will list all the elements with CPP class and exlude those which has CPP & Button class together.
Cheers, Saroj
Comments
Post a Comment