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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

130037 Apr 17,2017 07:53 PM Apr 18,2017 01:19 PM JavaScript 1
loading
Tags: ejKanban
Eric Griffith
Asked On April 17, 2017 07:53 PM

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

Rajesh Kumar Anburajan [Syncfusion]
Replied On April 18, 2017 01:19 PM

  
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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;