Declined
Last Updated: 16 Jul 2021 08:11 by ADMIN
Imported User
Created on: 05 Oct 2017 16:25
Category: MVVM
Type: Feature Request
3
Negation Operator on Bindings
I was trying to use negation operator in a binding using MVVM, just like angular does it, for example I am going to use, you could say why don't use "invisible", it could work on this example, but we have some others custom bindings, or some other scenarios were we have to create multiple properties to handle that, which is a pain.
EX
<div id="example-1" data-bind="visible: !IsNotAdmin"></div>
<div id="example-1" data-bind="customBinding: !IsAdmin"></div>
So, are you supporting the negation operator on bindings or are you planning to do it?
4 comments
ADMIN
Angel Petrov
Posted on: 16 Jul 2021 08:11

Hi,

I am glad that we were able to provide the needed information to clear things.

Regards,
Angel Petrov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Will
Posted on: 09 Jul 2021 11:29

Hi Angel, 

If I missed the ‘Visible’ binding, I apologize for my little rant. 

That said, I don’t know how I would have stumbled on ‘Invisible’ if ‘Visible’ was working at the time.  I can’t go back to how things were a year ago nor tell you what version I was basing my complaint upon.  But it wouldn't be the first time if I was wrong.

It’s niece to see that ‘Visible’ is available now and that it appears to be well documented.

Thanks,

Will Dougherty
ADMIN
Angel Petrov
Posted on: 09 Jul 2021 08:53

Hello,

Negation is not really the issue here. The real question is how to support complex evaluations inside the statements. The answer is to use a function in which to evaluate the desired. Here is a dojo that illustrates this.

As for visible vs invisible both are supported when it comes to applying MVVM to HTML. That said one can use the approach most suitable for him.

Regards,
Angel Petrov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Will
Posted on: 15 Jun 2020 14:36
Negation would be nice as a workaround but the real question in my mind is: if in every widget that supports control of visibility uses "VISIBLE" why in the world did someone think that when applying MVVM to HTML objects being so inconsistent as to use "INVISIBLE" was a good idea.  Is someone working to complicate things rather than simplify them? Geez!