Overriding Defaults in the Query Builder

Almost all data that is displayed inside the Query Builder (the list of targets, available operators, and some configuration options for the input fields) is defined inside the JCSDLDefinition object. You can overwrite this object to suit your requirements. In our Developer Resources section you will find an overview of the properties defined in an object.

To overwrite the settings you will need to set the Definition property in the Query Builder configuration. The definition property accepts an object with the JCSDLDefinition properties that you want to overwrite. You could, for example, overwrite the default parameters for the Facebook source and change the slider for the like count target. By default the slider goes from a minimum value of 0 to a maximum of 10,000; its default value is 500 and the step is 10.

For example. you could initialize your Query Builder instance with the following definition options:

<script type="text/javascript">
  var editor = new JCSDLGui($("#jcsdl"), {
    definition : {
      targets : {
        facebook : {
          fields : {
            'likes-count' : {
              max : 1000, 
              'default' : 500, 
              step : 1


The example above will make the slider for the Facebook like count look like this: