Test

Test

  • NA
  • 58
  • 51k

How to get the value from the attribute use jquery

Sep 22 2019 8:01 AM
I have a kendogrid where i am binding the data to ui using bind function i need to get the value from the returning result which i am unable to pull using $(assignedToMeByMeColl).attr('data-STATUS'); how can i get the value
 
What i tried
 
var status = $(assignedToMeByMeColl).attr('data-STATUS');
 
Code- Below is my kendo grid binding code i am getting the dataset result sets and from that result sets i need to get the status which will be either completed or pending
  1. $('#grid').kendoGrid({  
  2. scrollable: true,  
  3. resizable: true,  
  4. pageable: true,  
  5. reorderable: true,  
  6. sortable: {  
  7. mode: "single",  
  8. allowUnsort: false  
  9. },  
  10. pageable: {  
  11. refresh: true,  
  12. pageSizes: [25, 50],  
  13. change: function (e) {  
  14. if (ACurrentPage != $("#grid").data("kendoGrid").dataSource.page()) {  
  15. ACurrentPage = $("#grid").data("kendoGrid").dataSource.page();  
  16. SearchActivity(currentTab);  
  17. }  
  18. }  
  19. },  
  20. dataBound: onGridDataBound,  
  21. dataSource: {  
  22. data: assignedToMeByMeColl, pageSize: ACurrentPageSize  
  23. , page: ACurrentPage,  
  24. sort: {  
  25. field: ACurrentSortField,  
  26. dir: ACurrentSortDirection,  
  27. change: function (e) {  
  28. }  
  29. },  
  30. serverSorting: true,  
  31. serverPaging: true,  
  32. schema: {  
  33. total: function (assignedToMeByMeColl) { //HERE I AM GETTING TWO RESULT SETS I NEED TO GET THE VALUE FOR STATUS FROM THAT RESULT SET  
  34. debugger;  
  35. var status = $(assignedToMeByMeColl).attr('data-STATUS'); //TRIED THIS BUT GETTING UNDEFINED  
  36. return assignedToMeByMeColl[0].Count;  
  37. }  
  38. }  
  39. },  
  40. columns: [  
  41. { title: "Number", field: "ID", template: "<a class='anchorNavLinkStyle' href='javascript:void(0)' data-ID='#= ID#' onclick='RedirectToID(this)'>#=ID#</a>", width: 130 },  
  42. {  
  43. field: "FROM",  
  44. title: "FROM",  
  45. width: 100  
  46. }, {  
  47. field: "By",  
  48. title: "By",  
  49. width: 120  
  50. }, {  
  51. field: "To",  
  52. title: "To",  
  53. width: 120  
  54. }  
  55. , {  
  56. field: "ID",  
  57. title: "ID",  
  58. width: 100  
  59. }  
  60. , {  
  61. field: "TYPE",  
  62. title: "Type",  
  63. width: 130  
  64. },  
  65. { title: "Status", template: "<i class='fa fa-thumbs-up' data-ID='#=ID#' onclick='RedirectActivity(this)' title='Perform'></i>", width: 100 }  
  66. ,  
  67. ]  
  68. });  

Answers (1)