Read-only different colour for stings or numbers


#1

Hi,

I am wondering if anyone can help us. We have a parameter on current month and year. The rule in the cube if current month and year cells can be written or input data and if any outside the parameters it will be read-only for numbers and string (comments).

When we implented this to Canvas the numbers has the correct colour indiation where white is read-only and yellow is write, however, the comments or string the cells are still yellow either write or ready-only.

This can be seen in IE and Chrome and doesn’t seem to be a brower issue.

Thanks

Ed


#2

Hi @edward.luz,

Is this via the DBRs?

Can you post in here, the HTML code at least, how are you doing those colouring and indentations?

And if possible, a screenshot?

Thanks!


Paul


#3

Hi @plim,
Please see below sample codes











Thanks

Ed


#4

Hi @edward.luz,

We would need further information on this.

Can you post a screenshot on what it looks like?

Also, from the above, how are you applying the colours? Is it through the mrp-comments class? Can you also post what is the contents of that class?

Note that you were using multi-line. The input cells for the numeric cells are usually HTML Input tags. Where as with multi-lines, it usually is the HTML TextArea. Is mrp-comments class where you are applying the colours from?


Paul


#5

Hey @edward.luz,

I would use tm1-ui-class to achieve this, removing the class from your td tags, and adding it to your tm1-ui-dbr expressions:

tm1-ui-class=“my-class”

As you are using tm1-multi-line, you would need to create a .css class like following:

.my-class > form > textarea { .....my styles }

Jack


#6

Hi Paul and Jack,

Thanks for the replies. This is Nick - Ed’s colleague. Just wanted to further explain the issue. See below for the screen with the issue.

As Ed mentioned in his first post, we have a setting in the cube to indicate the current month and year. Below is the code for Current month open for editing

                        <tm1-ui-dbr tm1-instance="tm1serv"
                                    tm1-cube="System Info"
                                    tm1-elements="MRP Current Month,String"
                                    tm1-read-only="true"
                                    ng-model="page.currentMonthOpen">
                        </tm1-ui-dbr>
                        <tm1-ui-dbr tm1-instance="tm1serv"
                                    tm1-cube="System Info"
                                    tm1-elements="MRP Current Year,String"
                                    tm1-read-only="true"
                                    ng-model="page.currentYearOpen">
                        </tm1-ui-dbr>

On the left side, we have 2 dropdowns called Year and Current Month. Below is the code for those two. Notice the tm1-default-element="{{ page.currYear || page.currentYearOpen }}". This would set the default value to either a previously selected value (pulled from local storage) or if not present, the current year and month from the code above.

                        <tm1-ui-subnm tm1-instance="tm1serv"
                                      tm1-dimension="Year"
                                      tm1-subset="MRP Years"
                                      tm1-select-only="true"
                                      tm1-default-element="{{ page.currYear || page.currentYearOpen }}"
                                      ng-model="page.currYearSelected">
                        </tm1-ui-subnm>
                        <tm1-ui-subnm tm1-instance="tm1serv"
                                      tm1-dimension="Period"
                                      tm1-subset="MRP Months"
                                      tm1-select-only="true"
                                      tm1-default-element="{{ page.currMonth || page.currentMonthOpen }}"
                                      ng-model="page.currMonthSelected">
                        </tm1-ui-subnm>

Finally, we have the Cost Centre Codes table. Code below.

            <table class="table mrp-table">
                <tbody>
                    <tr ng-repeat="costCentreCode in page.costCentreCodes track by $index">
                        <td class="mrp-text-left" ng-repeat="code in page.codes track by $index">
                            <tm1-ui-dbr tm1-instance="tm1serv"
                                        tm1-cube="MRP Regional Parameter"
                                        tm1-elements="{{ page.currYearSelected }},{{ page.currMonthSelected }},{{ page.regionSelected }},{{ costCentreCode.key }},{{ code.key }}">
                            </tm1-ui-dbr>
                        </td>
                    </tr>
                </tbody>
            </table>

Ideally, we would want the inputs under the Cost Centre Codes table to be read-only if the current month and year selected from the dropdowns are not equal to the Current month open for editing. Ed has set up this security in the cube.

In canvas, this only works the first time the page is loaded. See below for screen.

If you change the Month dropdown to Feb (which effectively makes it the current month and year open for editing), the dbrs change to textboxes - which is correct. Now, the issue happens if you try to change it back to Jan. It’s expected to return to the read-only mode but it doesn’t.

Thanks in advance,
Nick


#7

Hi @nick.trinidad,

Thanks for the detailed screenshots and explanation.

There was an issue like that from before, though it has been fixed since. Had just tried it now too, and it is still able to switch between read-only and input boxes based on cell security.

Can you check on the following as these might give a clue as to what is happening:

  • Check the browser console, any errors that is being thrown in there?
  • When you switch between months, can you check that the DBR has received the updated month (i.e check via Reference context if it is enabled, and check the period element it is using)?

Lastly, what version of Canvas and TM1 are you using?


Paul


#8

Hi @plim,

  • No errors on the console
  • Months does change when switching on different months
  • Current Canvas version is 2.07

Thanks
Ed


#9

Hi @edward.luz,

Can you please contact your Cubewise Local office so they can help create and submit a ticket to support for this.

On that request, can you help put in the TM1 objects and a Canvas page to replicate this issue?


Paul


#10

Hi @plim @edward.luz

Sorry to open up an old thread. Just wondering if there is a solution for this issue? We are experiencing a similar thing where dbr formatting doesn’t not change back to read-only mode as expected.

Thanks
David


#11

Hi @anz.fin.all.mailbox,

No worries! Can you kindly contact your local Cubewise local office so they can help create and submit a ticket to support?

It will be helpful if you can also put in some sample TM1 objects and a Canvas page in support of the ticket that is to be submitted.

Thanks!


Paul


#12

Hi
There is a work around

<td class="text-right">
<span ng-if="myDecider === 'Jan' " >
  <tm1-ui-dbr ..... tm1-read-only="false" ></tm1-ui-dbr>              
</span> 

<span ng-if="myDecider != 'Jan' " >
  <tm1-ui-dbr-read-only  ..... ></tm1-ui-dbr-read-only>              
</span> 
</td>