Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] domain expression, rvalue supports multi-layer attributes (multiple dots) #118

Open
cabbage89 opened this issue Nov 19, 2022 · 0 comments

Comments

@cabbage89
Copy link

cabbage89 commented Nov 19, 2022

<field colSpan="4" name="myOrder" title="my orders" domain="self.order.id = :persion.order.orderId"/>


:persion.order.orderId Can be parsed from the model

https://github.com/axelor/axelor-open-platform/blob/master/axelor-web/src/main/webapp/js/axelor.data.js#L148

post: function(data, config) {
            if (data?.data?._domain) {
              var i = 0;
              data.data._domain = data?.data?._domain?.replaceAll(/:([^\s]*)/g, (__, path) => {
                if (path.indexOf('.') !== -1) {
                  let p = `__f${i++}`;
                  try {
                    data.data._domainContext[p] = eval(`data.data._domainContext.${path}`);
                  }catch (e){
                    data.data._domainContext[p]=null;
                  }
                  return ':' + p;
                }
                return __;
              });
            }
            return $http.post(url, data, config);
axeloradmin pushed a commit that referenced this issue Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant