MicroStrategy 10 Hacks: How to fire selector change via Button for any presentation mode

In order to provide usability to your Dashboards, you can let users the possibility to click somewhere and apply certain filter. For instance, you may want to filter a region by clicking a Button instead of scrolling inside a select list for some particular values:

binButtonAndEvent

1) MicroStrategy: Create a “Select List” Selector
CreateSelector
2) MicroStrategy: Select any panel or GRID as a destinationDestination
3) MicroStrategy: Create a MicroStrategy Button

CreateButton
4) jQuery: Clicking the button emulates selecting certain value of that select list

Since HTML code generated from Presentation and Interactive mode is completely different, you need to write different code for each case.

For Interactive Mode

Inspecting HTML generated, it displays as an standard HTML select list. You need to inspect element in order to retrieve its ID to reference it from jQuery:

SelectListID

You need to do the same for the button to locate its id:

ButtonID

Then you create an HTML Container which includes following code:

HTML Container with Interactive JS Code

Code above, emulates selecting value 1 (h1) from select list when user clicks Button object.

For Presentation Mode

In presentation mode, html generated code is different. If we inspect select list we’ll discover it gets rendered as a <div>. So, instead of finding Select List ID, in this case we need to identify HTML code of the entry value which we want to emulate. Let’s assume we want to trigger first value click, so we inspect our HTML code to search first value of the select list:

SelectListValueID_PresentationMode

A trick to find this value is to expand select list values and use “Inspect” tool and select the value. Once located, we’ll need to write down “idx” value of our entry  (idx=1 in the picture above) and its parent div id (mstr101 in the picture above).

Then we’ll do the same for the button:

ButtonID_PresentationMode

Under presentation mode, Id’s of elements contain special characters which we cannot use under jQuery. No problem. If you look carefully at HTML code you’ll see MicroStrategy added a “k” attribute which is an unique identifier, therefore we’ll use it to identify our button via jQuery.

Finally, we create an HTML Container with following code:

HTML Container with Presentation JS Code

At the code above, we bind a “click” event to our button (identifying it under jQuery via its K attribute) with a custom function click_button().  This function triggers click() event on select list first entry (which is located via jQuery searching from its parent DIV id to its child with idx attribute value = 1.).

In case you need to know how to integrate jQuery at both modes you should take a look to this other post:

http://www.relational.es/blog/microstrategy-10-hacks-loading-jquery-under-new-presentation-mode/

Hope this helps!

 

 

No comments yet.

Leave a Reply

MicroStrategy 10 Hacks: How to fire selector change via Button for any presentation mode

In order to provide usability to your Dashboards, you can let users the possibility to click somewhere and apply certain filter. For instance, you may want to filter a region by clicking a Button instead of scrolling inside a select list for some particular values:

binButtonAndEvent

1) MicroStrategy: Create a “Select List” Selector
CreateSelector
2) MicroStrategy: Select any panel or GRID as a destinationDestination
3) MicroStrategy: Create a MicroStrategy Button

CreateButton
4) jQuery: Clicking the button emulates selecting certain value of that select list

Since HTML code generated from Presentation and Interactive mode is completely different, you need to write different code for each case.

For Interactive Mode

Inspecting HTML generated, it displays as an standard HTML select list. You need to inspect element in order to retrieve its ID to reference it from jQuery:

SelectListID

You need to do the same for the button to locate its id:

ButtonID

Then you create an HTML Container which includes following code:

HTML Container with Interactive JS Code

Code above, emulates selecting value 1 (h1) from select list when user clicks Button object.

For Presentation Mode

In presentation mode, html generated code is different. If we inspect select list we’ll discover it gets rendered as a <div>. So, instead of finding Select List ID, in this case we need to identify HTML code of the entry value which we want to emulate. Let’s assume we want to trigger first value click, so we inspect our HTML code to search first value of the select list:

SelectListValueID_PresentationMode

A trick to find this value is to expand select list values and use “Inspect” tool and select the value. Once located, we’ll need to write down “idx” value of our entry  (idx=1 in the picture above) and its parent div id (mstr101 in the picture above).

Then we’ll do the same for the button:

ButtonID_PresentationMode

Under presentation mode, Id’s of elements contain special characters which we cannot use under jQuery. No problem. If you look carefully at HTML code you’ll see MicroStrategy added a “k” attribute which is an unique identifier, therefore we’ll use it to identify our button via jQuery.

Finally, we create an HTML Container with following code:

HTML Container with Presentation JS Code

At the code above, we bind a “click” event to our button (identifying it under jQuery via its K attribute) with a custom function click_button().  This function triggers click() event on select list first entry (which is located via jQuery searching from its parent DIV id to its child with idx attribute value = 1.).

In case you need to know how to integrate jQuery at both modes you should take a look to this other post:

http://www.relational.es/blog/microstrategy-10-hacks-loading-jquery-under-new-presentation-mode/

Hope this helps!

 

 

Tags: , , , ,

No comments yet.

Leave a Reply

MicroStrategy 10 Hacks: How to fire selector change via Button for any presentation mode

In order to provide usability to your Dashboards, you can let users the possibility to click somewhere and apply certain filter. For instance, you may want to filter a region by clicking a Button instead of scrolling inside a select list for some particular values:

binButtonAndEvent

1) MicroStrategy: Create a “Select List” Selector
CreateSelector
2) MicroStrategy: Select any panel or GRID as a destinationDestination
3) MicroStrategy: Create a MicroStrategy Button

CreateButton
4) jQuery: Clicking the button emulates selecting certain value of that select list

Since HTML code generated from Presentation and Interactive mode is completely different, you need to write different code for each case.

For Interactive Mode

Inspecting HTML generated, it displays as an standard HTML select list. You need to inspect element in order to retrieve its ID to reference it from jQuery:

SelectListID

You need to do the same for the button to locate its id:

ButtonID

Then you create an HTML Container which includes following code:

HTML Container with Interactive JS Code

Code above, emulates selecting value 1 (h1) from select list when user clicks Button object.

For Presentation Mode

In presentation mode, html generated code is different. If we inspect select list we’ll discover it gets rendered as a <div>. So, instead of finding Select List ID, in this case we need to identify HTML code of the entry value which we want to emulate. Let’s assume we want to trigger first value click, so we inspect our HTML code to search first value of the select list:

SelectListValueID_PresentationMode

A trick to find this value is to expand select list values and use “Inspect” tool and select the value. Once located, we’ll need to write down “idx” value of our entry  (idx=1 in the picture above) and its parent div id (mstr101 in the picture above).

Then we’ll do the same for the button:

ButtonID_PresentationMode

Under presentation mode, Id’s of elements contain special characters which we cannot use under jQuery. No problem. If you look carefully at HTML code you’ll see MicroStrategy added a “k” attribute which is an unique identifier, therefore we’ll use it to identify our button via jQuery.

Finally, we create an HTML Container with following code:

HTML Container with Presentation JS Code

At the code above, we bind a “click” event to our button (identifying it under jQuery via its K attribute) with a custom function click_button().  This function triggers click() event on select list first entry (which is located via jQuery searching from its parent DIV id to its child with idx attribute value = 1.).

In case you need to know how to integrate jQuery at both modes you should take a look to this other post:

http://www.relational.es/blog/microstrategy-10-hacks-loading-jquery-under-new-presentation-mode/

Hope this helps!

 

 

No comments yet.

Leave a Reply