We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to find out the current count of a column from the columnKey?

I would like to get the current count of cards displayed within a specific column key.  So imagine having a column with the column key "ABC".  I would like to do something like ejKanbanObj.columns.getCount(columnKey).

Eric

1 Reply

RK Rajesh Kumar Anburajan Syncfusion Team April 18, 2017 05:19 PM UTC

  
Hi Eric Griffith, 

Thanks for contacting syncfusion support. 

The requested requirement of " How to find out the current count of a column from the columnKey" can be achieved through simple workaround solution. Here you can extend Kanban object to add  “getCount” method to achieve your requirement. 
Please refer to the following code snippets:  
Default.html 
……… 
create: function (args) { 
                                        var kbnObj = $('#Kanban').data('ejKanban'); 
                                        kbnObj.getCount = function (key) {  // Here you use the getcount method 
                                            data = new ej.DataManager(kbnObj.getCurrentJsonData()).executeLocal(new ej.Query().where(kbnObj.model.keyField, ej.FilterOperators.equal, key)); 
                                            return data.length; 
                                        } 
                                    } 
…….. 
<script> 
        function buttonClick(args) { 
            var kbnObj = $('#Kanban').data('ejKanban') 
            var count = kbnObj.getCount("Open"); 
            alert("Cards Count: " + count); 
        } 
    </script> 
……….. 

Please check the bellow sample. 

 
Let us know if any queries.  

Regards, 
Rajesh Kumar.A 


Loader.
Up arrow icon