mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-07-10 03:45:04 +00:00
cbind: allow to pass "formula" function in binding
can often ve useful and doesn't hurts, somewhat similar to ExtJS forumlas in viemodels, but inline. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
1d5e523aa0
commit
149851638d
@ -37,7 +37,10 @@ Ext.define('Proxmox.Mixin.CBind', {
|
||||
cdata = cbind[prop];
|
||||
|
||||
found = false;
|
||||
if (match = /^\{(!)?([a-z_][a-z0-9_]*)\}$/i.exec(cdata)) {
|
||||
if (typeof cdata === 'function') {
|
||||
obj[prop] = cdata(getConfigValue, prop);
|
||||
found = true;
|
||||
} else if (match = /^\{(!)?([a-z_][a-z0-9_]*)\}$/i.exec(cdata)) {
|
||||
var cvalue = getConfigValue(match[2]);
|
||||
if (match[1]) cvalue = !cvalue;
|
||||
obj[prop] = cvalue;
|
||||
|
Loading…
Reference in New Issue
Block a user