DataTable gets column data

Source: Internet
Author: User

1Get_spec_col_data:function(custom_options) {2             varresult = [];3             varOptions = {4TABLE_ID: ",5Table_data_key: ' Grid ',6column_index:0,7Selectedfalse,8Select_type: ' checkbox '9             }Ten jquery.extend (options, custom_options); Oneoptions.table_id = ' # ' +options.table_id; A             varMulti_data =false; -             if(typeof(options.column_index) = =undefined) { -                 returnresult; the}Else if((Options.column_index.constructor + "). Match (/function array\ (\)/)! =NULL ) { -Multi_data =true; -             } -             varData_arr = Jquery.data (JQuery (options.table_id) [0], Options.table_data_key). Fngetdata (); +             if(Options.select_type = = ' Radio ') { -                 varNodes_arr = JQuery (' Td:first input:radio ', +Jquery.data (JQuery (options.table_id) [0], Options.table_data_key). Fngetnodes ()); A}Else if(Options.select_type = = ' checkbox ') { at                 varNodes_arr = JQuery (' Td:first input:checkbox ', -Jquery.data (JQuery (options.table_id) [0], Options.table_data_key). Fngetnodes ()); -}Else { -                 returnresult; -             } -  in              for(vari = 0; i < data_arr.length; i++) { -                 if(!options.selected | | (Nodes_arr[i] &&nodes_arr[i].checked)) { to                     if(multi_data) { +                         varTMP = []; -                          for(varj = 0; J < Options.column_index.length; J + +){ the Tmp.push (Data_arr[i][options.column_index[j]); *                         } $ Result.push (TMP);Panax Notoginseng}Else{ - Result.push (Data_arr[i][options.column_index]);  the                     } +                 } A             } the              +             //Set hidden checked record. -             if(options.selected) { $                 //If The temporary data is existed (i.e. this method is called $                 //From Fndrawcallback), the temporary data, which is included -                 //checked hidden data and displayed record, should be used. -                 var$table =$ (options.table_id), theTarget_data =esf_fw.table.get_tmp_raw_check_data_list ($table); -                 if(!target_data) {WuyiTarget_data = the Esf_fw.table.get_hidden_raw_check_data ($ (options.table_id)); -                 } Wu                  -                 if(multi_data) { About$.each (Target_data,function(key, value) { $                         varTMP = []; -$.each (Options.column_index,function(J, index) { - Tmp.push (Value[index]); -                         }); A Result.push (TMP); +                     }); the}Else { -$.each (Target_data,function(key, value) { $ Result.push (Value[options.column_index]); the                     }); the                 } the              the             } -             returnresult; in},

DataTable gets column data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.