Query - where : Invalid arguments

Hello, we are getting this error when trying to assign a datasource to a preinitialized Kanban board in JS:


Error: Query - where : Invalid arguments
    at f (http://localhost/ScriptResource.axd?d=dEKVobek…hisJqPTPIx5hAKxFbJr797lSgHucfpIEYMze7LkpgJif41&t=ffffffff95a61f14:10:67571)
    at Object.where (http://localhost/ScriptResource.axd?d=dEKVobek…hisJqPTPIx5hAKxFbJr797lSgHucfpIEYMze7LkpgJif41&t=ffffffff95a61f14:10:12758)
    at i._ensureDataSource (http://localhost/ScriptResource.axd?d=1RdZeeYf…dWwz4LVm_5NEr3yRPs-4QP_7EEPB-Ig-vZoYiGRPbBCg1&t=ffffffff95a61f14:10:234565)
    at n._processBindings (http://localhost/ScriptResource.axd?d=1RdZeeYf…dWwz4LVm_5NEr3yRPs-4QP_7EEPB-Ig-vZoYiGRPbBCg1&t=ffffffff95a61f14:10:142509)
    at i.refresh (http://localhost/ScriptResource.axd?d=1RdZeeYf…dWwz4LVm_5NEr3yRPs-4QP_7EEPB-Ig-vZoYiGRPbBCg1&t=ffffffff95a61f14:10:235405)
    at n._refreshDataSource (http://localhost/ScriptResource.axd?d=1RdZeeYf…dWwz4LVm_5NEr3yRPs-4QP_7EEPB-Ig-vZoYiGRPbBCg1&t=ffffffff95a61f14:10:174492)
    at n._kanbanSetModel (http://localhost/ScriptResource.axd?d=1RdZeeYf…dWwz4LVm_5NEr3yRPs-4QP_7EEPB-Ig-vZoYiGRPbBCg1&t=ffffffff95a61f14:10:168980)
    at i._setModel (http://localhost/ScriptResource.axd?d=1RdZeeYf…dWwz4LVm_5NEr3yRPs-4QP_7EEPB-Ig-vZoYiGRPbBCg1&t=ffffffff95a61f14:10:194091)
    at i.setModel (http://localhost/ScriptResource.axd?d=T6pKVvIE…_Z2OWaMNQjtcGRv3e4yYJjRh0f8c2nEifUI3GVxgyGmKE1&t=ffffffff95a61f14:10:14488)
    at jQuery.n.fn.(anonymous function) [as ejKanban] (http://localhost/ScriptResource.axd?d=T6pKVvIE…_Z2OWaMNQjtcGRv3e4yYJjRh0f8c2nEifUI3GVxgyGmKE1&t=ffffffff95a61f14:10:23532)


In our code we are just calling ejKanban assigning data source, which is a JS array retrieved from AJAX call

                    $("#<%= Kanban.ClientID %>").ejKanban(
                        {
                            dataSource: data,
                            keyField: "LeadStageUID"
                        }
                    );

What should we look for to find the cause of this error?


2 Replies

BD Boris Dongarov June 25, 2018 08:04 PM UTC

We figured: this error was due to the empty column list.


BS Buvana Sathasivam Syncfusion Team June 26, 2018 12:46 PM UTC

Hi Boris, 

Thanks for using Syncfusion Products. 

We were able to reproduce your reported issue at our end.  This issue because of, you are mapping columns keyField but not used in columns key value.  You should specify column key values when you can used the keyField property in the Kanban board.  Please find the below code. 

KanbanFeatures.aspx 

$("#<%=Kanban.ClientID%>").ejKanban({ 
       dataSource: KanbanData,  // Loaded data using ajax post 
       columns: [ 
             { headerText: "Backlog", key: "Open" }, 
             { headerText: "In Progress", key: "InProgress" }, 
             { headerText: "Done", key: "Close" } 
       ], 
       keyField: "Status" 
}) 
    
Primary key is mandator for ‘Drag and drop’, ‘Selection’ and ‘Editing’ features. 

If you wish to render Kanban control in web forms and add a datasource on server side data, then you can follow the below sample level solution.  Because, after an ajax post called, server side code behind is again called.  Due to this server call, Kanban has shown on initially defined data.  So, we suggest you can use code behind options for to define the server side data into a Kanban board or else you can dynamically change the Kanban data into the code behind options and define the other Kanban properties into client side button click event.  Please find the below code. 

KanbanFeatures.aspx 

<ej:button ID="Start" runat="server" OnClick="Button_Click"></ej:button> // server side event 
 
<ej:Kanban ID="Kanban" runat="server">  // Render Kanban 
</ej:Kanban> 
   
KanbanFeatures.aspx.cs 

protected void Button_Click(object sender, Syncfusion.JavaScript.Web.ButtonEventArgs e)    // Triggered when button click 
        { 
      Task.Add(new Tasks(29, "Testing")); 
       this.Kanban.DataSource = Task; 
            
            Kanban.Columns.Add(new Syncfusion.JavaScript.Models.KanbanColumn 
            { 
                HeaderText = "Open", 
                Key = new List<String> { "Open" }, 
            }); 
            Kanban.Columns.Add(new Syncfusion.JavaScript.Models.KanbanColumn 
            { 
                HeaderText = "Close", 
                Key = new List<String> { "Close" }, 
            }); 
            Kanban.KeyField = "Status"; 
            Kanban.Fields.PrimaryKey = "Id"; 
            Kanban.Fields.Content = "Summary"; 
            this.Kanban.DataBind(); 
} 


Please find the below sample. 

Please find the below documentation link. 

Please find the below API document. 


Regards, 
Buvana S 
 


Loader.
Up arrow icon