Kanban updateCard JS Error Cannot read property '0' of undefined

Dear,

i have a Kanban board with a Context Menu to Confirm Cards. Confirmed cards are collapsed. When I use the context menu toghether with a search or filter, I get a JS error on updateCard:

        function contextClick(args) {
            if ((args.text == "Reset Card" || args.text == "Confirm Card") && this.element.find(".e-kanbancard").hasClass("e-cardselection")) {
                var kObj = $("#<%=kanPlanBoard.ClientID%>").data("ejKanban"), selectedCard, selectedCardData, selectedCardId;
                selectedCard = kObj.element.find('.e-cardselection');
                selectedCardId = selectedCard.attr('id');
                selectedCardData = new ej.DataManager(kObj.getCurrentJsonData()).executeLocal(new ej.Query().where(kObj.model.fields.primaryKey, ej.FilterOperators.equal, selectedCardId))[0];

                var oOrderID = selectedCardData.OrderID;
                var oStatusID = (args.text == "Reset Card" ? -20 : -21);
                kObj.updateCard("OrderID", { OrderID: oOrderID, StatusID: oStatusID });
            }
        }
Uncaught TypeError: Cannot read property '0' of undefined
    at n._kanbanUpdateCard (ej.web.all.min.js:10)
    at i.updateCard (ej.web.all.min.js:10)
    at i.contextClick (PlanDepot.aspx:323)
    at i._trigger (ej.web.all.min.js:10)
    at n._kanbanContextClick (ej.web.all.min.js:10)
    at i._clickevent (ej.web.all.min.js:10)
    at Object.i (jquery-3.4.1.min.js:2)
    at Object._trigger (ej.web.all.min.js:10)
    at Object._onClickHandler (ej.web.all.min.js:10)
    at HTMLLIElement.<anonymous> (ej.web.all.min.js:10)

                    <ej:Kanban ID="kanPlanBoard" runat="server" KeyField="TransportDepotID" AllowFiltering="True" AllowSearching="True" AllowToggleColumn="True" EnableTotalCount="True" ShowColumnWhenEmpty="True" Locale="nl-BE" AllowPrinting="True" AllowTitle="True" IsResponsive="True" SelectionType="Single" AllowHover="False">
                        <DataManager URL="PlanDepot.aspx/GetOrders" CrudURL="PlanDepot.aspx/Crud" Adaptor="WebMethodAdaptor"></DataManager>
                        <CustomToolBarItems>
                            <ej:KanbanCustomToolBarItems Template="#DeleteCard" />
                            <ej:KanbanCustomToolBarItems Template="#ResetCard" />
                            <ej:KanbanCustomToolBarItems Template="#ConfirmCard" />
                            <ej:KanbanCustomToolBarItems Template="#Refresh" />
                            <ej:KanbanCustomToolBarItems Template="#PrintPOD" />
                        </CustomToolBarItems>
                        <ContextMenuSettings Enable="true" MenuItems=" ">
                            <CustomMenuItems>
                                <ej:CustomMenuItem Text="Confirm Card" Target="Card" />
                                <ej:CustomMenuItem Text="Reset Card" Target="Card" />
                            </CustomMenuItems>
                        </ContextMenuSettings>
                        <ClientSideEvents ToolbarClick="toolbarClick" ActionBegin="actionBegin" ContextClick="contextClick" />
                        <Fields PrimaryKey="OrderID" Content="Summary" Title="CustomerName" Tag="Tags" Color="ColorMapping" ImageUrl="ImageUrl">
                            <CollapsibleCards Field="Collapsed" Key="COLLAPSED" />
                        </Fields>
                        <ToolTipSettings Enable="false" />
                        <CardSettings>
                            <ColorMappings>
                                <ej:KeyValue Key="#ee4e75" Value="Pink" />
                                <ej:KeyValue Key="#57b94c" Value="Green" />
                                <ej:KeyValue Key="#edba3c" Value="Yellow" />
                                <ej:KeyValue Key="#5187c6" Value="Blue" />
                            </ColorMappings>
                        </CardSettings>
                        <FilterSettings>
                            <ej:KanbanFilterSetting Text="SHIP" Query="new ej.Query().where('Collection', 'equal', false)" Description="Displays Shipments" />
                            <ej:KanbanFilterSetting Text="COL" Query="new ej.Query().where('Collection', 'equal', true)" Description="Displays Collections" />
                            <ej:KanbanFilterSetting Text="BOOK" Query="new ej.Query().where('BookIn', 'equal', true)" Description="Displays Orders To Book In" />
                            <ej:KanbanFilterSetting Text="FIX" Query="new ej.Query().where('FixedHr', 'equal', true)" Description="Displays Orders Fix Appointment" />
                            <ej:KanbanFilterSetting Text="AM" Query="new ej.Query().where('Before12', 'equal', true)" Description="Displays Orders <12:00" />
                            <ej:KanbanFilterSetting Text="PM" Query="new ej.Query().where('After12', 'equal', true)" Description="Displays Orders >12:00 " />
                            <ej:KanbanFilterSetting Text="NEW" Query="new ej.Query().where('PrintedDelNote', 'equal', false)" Description="POD Not Printed" />
                            <ej:KanbanFilterSetting Text="10" Query="new ej.Query().where('PZ', 'equal', 'BE1')" Description="Displays PC 1000" />
                            <ej:KanbanFilterSetting Text="20" Query="new ej.Query().where('PZ', 'equal', 'BE2')" Description="Displays PC 2000" />
                            <ej:KanbanFilterSetting Text="30" Query="new ej.Query().where('PZ', 'equal', 'BE3')" Description="Displays PC 3000" />
                            <ej:KanbanFilterSetting Text="40" Query="new ej.Query().where('PZ', 'equal', 'BE4')" Description="Displays PC 4000" />
                            <ej:KanbanFilterSetting Text="50" Query="new ej.Query().where('PZ', 'equal', 'BE5')" Description="Displays PC 5000" />
                            <ej:KanbanFilterSetting Text="60" Query="new ej.Query().where('PZ', 'equal', 'BE6')" Description="Displays PC 6000" />
                            <ej:KanbanFilterSetting Text="70" Query="new ej.Query().where('PZ', 'equal', 'BE7')" Description="Displays PC 7000" />
                            <ej:KanbanFilterSetting Text="80" Query="new ej.Query().where('PZ', 'equal', 'BE8')" Description="Displays PC 8000" />
                            <ej:KanbanFilterSetting Text="90" Query="new ej.Query().where('PZ', 'equal', 'BE9')" Description="Displays PC 9000" />
                            <ej:KanbanFilterSetting Text="NL" Query="new ej.Query().where('PZ', 'startsWith', 'NL')" Description="Displays NL" />
                        </FilterSettings>
                    </ej:Kanban>



1 Reply

BS Balasubramanian Sattanathan Syncfusion Team July 30, 2020 05:06 PM UTC

Hi Peter, 

Greetings from Syncfusion Support. 

We have validated your reported problem “Kanban updateCard JS Error Cannot read property '0' of undefined” at our side and we suspect that the Kanban instance is not getting properly while using the context menu with search/filter. So we suggest you to check whether the Kanban instance is properly getting or not. And kindly share the sample illustrating the reported problem or else share your convenient timing, so as to look onto your reported problem on your machine directly. We will make every effort to have this scheduled on a date and time of your convenience to resolve it quickly   

Regards, 
Balasubramanian S 


Loader.
Up arrow icon