ng-admin icon indicating copy to clipboard operation
ng-admin copied to clipboard

how can I use other field's value be a query condition with referenceField

Open jiaming0708 opened this issue 7 years ago • 1 comments

I want to use other field to be a query condition, but I have no idea how to do

var curriculum = nga.entity('curriculums');

nga.field('region', 'reference'),
nga.field('curriculum', 'reference')
          .targetEntity(curriculum)
          .targetField(nga.field('name'))
          .remoteComplete(true, {
            refreshDelay: 300,
            searchQuery: function (search) {
            // use the region be the query condition
              return { q: search };
            }
          }),

jiaming0708 avatar Oct 18 '18 10:10 jiaming0708

or I can trigger the curriculum field values when region change?

jiaming0708 avatar Oct 18 '18 10:10 jiaming0708