stephengolub / rxDataTable

A "catch-all" solution for displaying data in a table format in a basic or extremely complex style.
MIT License
15 stars 8 forks source link

Thanks for a great job on rx-data-table - possible issue with checkbox clickAction(...) #45

Open ghost opened 9 years ago

ghost commented 9 years ago

Hi Nick,

Thanks for a great job on rx-data-table - a really nice implementation!!

Am having an issue with checkbox clickAction(). While I can get the checkbox field to display OK in my table - I cannot get the clickAction(...) function to fire. Do you have a working example handy?

BTW - am using 'controller as' syntax. Here are my test data, config object and clickAction function:

myThis.dtConfig = [
                    {'title': 'Select',
                     'dataField': 'vacSelected',
                     'checkbox': true,
                     'cols': 1
                    },
                    {'title': 'Vaccine',
                     'dataField': 'vacName',
                     'cols': 1
                    },
                    {'title': 'Source',
                      'dataField': 'vacSource',
                      'cols': 1
                    }
                  ];    
myThis.dtData = [ 
                   {vacSelected: 'firstSelected', vacName: 'RX first Vac Name', vacSource: 'RX first Vac Source'},
                   {vacSelected: 'secondSelected', vacName: 'RX second Vac Name', vacSource: 'RX second Vac Source'},
                   {vacSelected: 'thirdSelected', vacName: 'RX third Vac Name', vacSource: 'RX third Vac Source'}
                  ];

//clickAction function called by rx-data-table when a checkbox is clicked
$scope.clickAction = function(fieldId) {
    alert( 'clickAction(' + fieldId + ') called!!' );
};

What am I doing wrong? Many thanks in advance for you help!!

Best,

Brian Cummings

stephengolub commented 9 years ago

Sorry for taking so long to get back to this.

The checkbox functionality is rather lacking at this point. So it not working is expected. I apologize for the poor documentation on this.

Feel free to submit a PR. :D