Manipulate Current Selection of SUBNM from JS

It would be really handy if we could set the current selection of a SUBNM through the subnm api object.
In our Version (1.0.5) this is not possible. Will this feature come in the future?

Hi @mwirtz,

You should be able to do this via the tm1-default-element attribute, as this attribute is being watched. Chaning the value here will also update the current selection on the SUBNM.

Cheers!


Paul

Hi Paul,

this doenst work for us. Maybe I am getting you wrong.

Here is what I do:

  1. When I create the SUBNM in the HTML I add the attribute to the definition:
                    <tm1-ui-subnm tm1-instance="dev"
                                tm1-dimension="IR Company"
                                tm1-attribute="Code and Name"
                                tm1-subset="MDX N Elements"
                                tm1-show-hierarchy="false"
                                tm1-default-element="page.defaultCompany"
                                tm1-api="page.subnm.api"
                                ng-model="page.selectedCompany">
                    </tm1-ui-subnm>
  1. then at a later point I assign $scope.page.defaultCompany = “1003” in JS.

Is that what I was supposed to do?
We are on 1.0.5 according to the help section tm1-default-element should be Watched.

Cheers,

Marius

Hi @mwirtz,

That should be with with curly brackets --> {{page.defaultCompany}}.

Cheers!


Paul

Works like a charm! Thank you