M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 34
Registered: ‎04-19-2018

Analyzer - update and reload M.App Enterprise dataset

Hi guys,

 

I'm trying to add chart of type "HTML Display". I want to use the example "update and reload M.App Enterprise dataset".

 

It works fine, I can load the filtered dataset correctly. But when I click any of the other charts it resets to the first value.

Is there any way to keep value that the user has selected?

 

 

Thank you

Elisa.

Highlighted
Technical Evangelist
Posts: 808
Registered: ‎11-12-2015

Re: Analyzer - update and reload M.App Enterprise dataset

Hi Elisa,

 

I am not sure I understand your query from this description.

Is it possible for you to add more information in the way of screenshot/illustration? One of working and one of the result from click on chart would be helpful I think.

Highlighted
Contributor
Posts: 34
Registered: ‎04-19-2018

Re: Analyzer - update and reload M.App Enterprise dataset

Yes of course, it would be more clarify

 

I've loaded the entity "Terrasses" and it works well.

Captura1.PNG

 

 

But, when I click on the other chart to filter some results, the value of the combobox changes automatically to the first value of the list. I would like this value doesn't change until the user does.

 

Captura2.PNG

 

 

Thank you.

Elisa

 

 

Highlighted
Technical Evangelist
Posts: 808
Registered: ‎11-12-2015

Re: Analyzer - update and reload M.App Enterprise dataset

[ Edited ]

Hi Elisa,

 

When you click on the 'other chart' it is again filtering based on the clicked category.

In this sense the user is choosing to change the filter and the drop down list will change dependent on the new user selection.

 

The combo box should only change value to first in the list if no filter is applied or all filters are applied. Otherwise the value in combobox will default to the first value true given the current filter.

No Filter and Combobox (Adelaide Ave is first value)

AllFilterApplied.JPG

 

Some filter applied

SomeFilterApplied.JPG

 

Highlighted
Contributor
Posts: 34
Registered: ‎04-19-2018

Re: Analyzer - update and reload M.App Enterprise dataset

Hi,

 

I think we are not talking about the same.

 

I'm using the additional chart type "HTML Disyplay" and this example to load data from M.App Enterprise using SQL Query Interface.

 

 

<!-- 
This example is designed to work with M.App Enterprise and attribute data.
It uses the M.App Enterprise SQL Query Interface to query and load point data (as attribute data).
Using attribute data in place of a Vector Set is recommended when using point data.
Loading point data in this fashion is more efficient than using a Vector Set. 
This example contains code to:
	- display a button
	- create a drop-down list
	- populate a drop-down list with display items
	- construct an SQL query based upon item selected in drop-down list
	- execute SQL query
	- load new data
-->

<style type="text/css">
	
	.myButton {
		margin-left: 5px;
    	display: table;
        height:24px;
        font-size:12px;
	    width: 60px
	}
	
</style>

<div style="margin-left:10px; margin-top:5px">
	<div>
		<select style="float:left;width:200px;height:24px" id="myAttributeLoader">
			<option value="1">Load Query Parameter 1</option>
			<option value="2">Load Query Parameter 2</option>          	
		</select>
    </div>
	<div class="smallCommandButton myButton" onclick="
                               
		// Display a loading screen when button is clicked
		ModalDialogModel.model.show($.i18n('please_wait_template'), $.i18n('message_pleaseWait'));                               

		// Get value from the drop down
		var val =  $('#myAttributeLoader').val();
		
		// Contruct query parameters
		var query = val ? 'where --field name--='' + val + ''' : '';                              
		
		// Construct URL
        var datasetUrl = 'https://--M.App Enterprise Server--/api/v1/sqlquery/--Atttribute/Vector Data Name--?query=SELECT * FROM --table name-- ' + query + '&format=csv';							
		Analyzer.updateDataset({
				stageModel: null,
				dataset: datasetUrl,
				fitFeatues: true,
				clearFilters: false
			})
		.then (() => {                                                      
			ModalDialog.hide();                                                      
		});

		// Update the title bar text
		Analyzer.updateTitle('Features from dataset ' + val);">
  	<span>Load</span>
	</div>
</div>

 

It works well, I can load different data using the dropdown list correctly.

 

But my problem is, when I click on any of the other widgets to use more filter, it changes automatically to the first value of the list. (so it's showing a value that not corresponds with the loaded data).

 

 

is this clearer now?

 

 

Thank you very much.

Elisa