How can I update the targetId of a particular RQB element?

73 views Asked by At

I have an element on the page, i.e.

I then add the RQB element with:

  RedQueryBuilderFactory.create({targetId:'foo1',
      meta:myMeta,
      onSqlChange:sqlChange,
      onTableChange:tableChange,
      enumerate:enumerate,
      suggest:suggest,
      editors : [ {
          name: 'DATE',
          format : 'dd.MM.yyyy'
      }
                 ]},
      sql,
      args);

I then change the id of the containing div via $('#foo1').attr('id','foo2');

How do I update the targetId in the RQB instance config so that it will also be 'foo2' to that it matches the containing div?

1

There are 1 answers

4
salk31 On

I think the targetId is only used once when the widget is setup. The only call to get that value I can find is here: https://github.com/salk31/RedQueryBuilder/blob/master/redquerybuilder-js/src/main/java/com/redspr/redquerybuilder/js/client/RedQueryBuilder.java#L58

Is there a problem after you change the id of the element?