         @createQuery(nextProps.lines) if nextProps.lines
 
     createQuery: (lines) ->
-        @query = new Lanes.Models.Query
+        @query = new Lanes.Models.Query(@props.queryBuilder({
             title: 'Lines'
             defaultSort: false
-            src: lines, fields: [
+            src: lines,
+            fields: [
                 { id:'id', visible: false         }
                 { id: 'sku_code', fixedWidth: 150 }
                 { id: 'description', flex: 2      }

                    format: (v, r, q) -> v?.toFixed(2)
                }
            ]

    onSkuChange: (sku, options) ->
        options.model.set({sku})

        lines:    Lanes.PropTypes.Collection.isRequired
        commands: React.PropTypes.object.isRequired
        location: Lanes.PropTypes.Model.isRequired
        queryBuilder: React.PropTypes.func.isRequired
        saveImmediately: React.PropTypes.func.isRequired

    getDefaultProps: ->
        queryBuilder: (a) -> a

    componentWillMount: ->
        @createQuery(@props.lines)
