问题描述
我有1000+的数据,我需要放置在一个ngTable但不是1专栏中,我需要分割该数据为多列,说2,用后20个项目筛选和分页。是否有可能与ngTable?
例如:我有100个项目。在第1页,我将有 20月1日在第一列项和 2日20第2列项
下面是我的模板
< DIV CLASS =COL-MD-12>
<形式的作用=搜索级=导航栏,导航栏的形式左>
< DIV CLASS =表单组>
<输入类型=文本占位符=搜索级=的形式控制搜索输入框NG模型=namingConventionSearchText/>
< / DIV>
< /表及GT;
< / DIV>
<表类=表NG表=namingConventionParams>
< TR NG重复=项items.instanceData |过滤器:namingConventionSearchText>
< TD风格=字突破:突破一切> {{}项}< / TD>
< / TR>
< /表>
控制器code
$ scope.items = {
头衔:任务,
instanceData:[MOD_INT_REPL_INTERFACE_OBJ_DLY,MOD_INT_REPL_INTERFACE_OBJ_DLY_test,Test_By_Justin,ENG_ATTACHMENT,ENG_CONV_Z_SFDC_US_PM_PATIENT_CASE_TO_SFDC_PATIENT_CASE_INSERT,ENG_CONV_Z_SFDC_US_PM_PATIENT_PRODUCT_TO_SFDC_PATIENT_PRODUCT_INSERT,US_SYNC_ODS2ATHENS_ADDR_ATHENSID,测试,US_VEVA_2_ODS_REPL_Customer_Maintenance,US_VEVA_2_ODS_REPL_USER_TERR,AAAA, AAATEST5,ACCT_VIS_ZIP_TO_TERR_FLTR,ADDRESS_MERGE_PROC_TEST,AGGSPEND_ODStoFF _WKLY,ARA_USER_TERR,Account_StgtoODS_Account,Account_StgtoODS_Account_Old,Account_edit,ActivityLog,Address_STGtoODS_Address,Address_STGtoODS_Address_Old,Affiliation_CMtoATHENS_STGtoODS,BAV_ACCT_TERR_LOAD_DELTA ,BAV_BUS_ACNT_ALIGN,BAV_REP_ALIGN,BAV_UPDATE_TSF,CALL2_SAMPLE复制inMIG,CALL_OUTBOUND_DELETE,CA_CIRCULO_INTERFACE_REPL_OBJ,CA_CIRCULO_REPL_ACCOUNT,CA_CIRCULO_REPL_ADDRESS,CA_CIRCULO_REPL_CALL,CA_CIRCULO_REPL_CALLSAMPLE,CA_CIRCULO_REPL_PRODUCTCATALOG,CA_CIRCULO_REPL_USER ,CEG_ACCOUNT_UPDATE,CEG_ACCOUNT_UPDATE1,CI_Agra_Samples_FF_STG,CM_US_REPLtoFF_ACCOUNT,CM_US_REPLtoFF_ADDRESS,CM_US_REPLtoFF_CHILD_ACCOUNT,CM_US_REPLtoFF_CHILD_ACCOUNT_Test,CUSTOM_INTEGRATION_TEST,Agra_Account_Merge_Id,Agra_Samples_FF_to_STG1,Agra_Samples_Product_OB,Agra_Samples_STG1_to_STG2, Agra_Samples_User_OB,同意,Corp_BI_NZ_OR,Corp_BI_SYC_ORA_NTZ,CyclePlan,CyclePlan详细信息]
}; $ scope.namingConventionParams =新ngTableParams({
页面:1,//显示第一页
数:10
},{
defaultSort:ASC
总:数据$ scope.items.instanceData.length,//长度
罪状:[],
的getData:函数($延迟,则params){
VAR orderedData = params.sorting()? $过滤器('排序依据')($ scope.items.instanceData,params.orderBy()):$ scope.items.instanceData;
orderedData = params.filter()? $过滤器('过滤器')(orderedData,params.filter()):orderedData;
$ scope.task_data = orderedData;
$ scope.task_data = orderedData.slice((params.page() - 1)* params.count(),params.page()* params.count());
params.total(orderedData.length);
$ defer.resolve($ scope.task_data);
}
});
更新
下面是我的。
所有我想尝试绑定到ngTable那会感觉更自然的ngTable之前,我的字符串数组映射到对象数组的第一个。事情是这样的 [字符串A,串B]
将映射到 [{指数:0,文本:字符串A' },{指标:1,文字:'字符串B'}];
这是我在一个字符串数组方面提出了同样分成每页两列。注意为自定义范围过滤器我用:
VAR应用= angular.module('主',['ngTable'])\r
.filter('片',函数(){\r
返回功能(物品,页面大小){\r
返回items.slice((页 - 1)*大小,页面大小*);\r
}\r
})\r
.filter('范围',函数(){\r
返回功能(开始,长度){\r
VAR范围= [];\r
对于(VAR I =启动; I<起动+长;我++){\r
range.push(ⅰ);\r
}\r
返回范围;\r
}\r
})\r
.controller('DemoCtrl',函数($范围,$过滤器,ngTableParams,$日志){\r
$ scope.items = {\r
头衔:任务,\r
的tableHeader:项目,\r
instanceData:[MOD_INT_REPL_INTERFACE_OBJ_DLY,MOD_INT_REPL_INTERFACE_OBJ_DLY_test,Test_By_Justin,ENG_ATTACHMENT,ENG_CONV_Z_SFDC_US_PM_PATIENT_CASE_TO_SFDC_PATIENT_CASE_INSERT,ENG_CONV_Z_SFDC_US_PM_PATIENT_PRODUCT_TO_SFDC_PATIENT_PRODUCT_INSERT,US_SYNC_ODS2ATHENS_ADDR_ATHENSID,测试,US_VEVA_2_ODS_REPL_Customer_Maintenance,US_VEVA_2_ODS_REPL_USER_TERR,AAAA, AAATEST5,ACCT_VIS_ZIP_TO_TERR_FLTR,ADDRESS_MERGE_PROC_TEST,AGGSPEND_ODStoFF _WKLY,ARA_USER_TERR,Account_StgtoODS_Account,Account_StgtoODS_Account_Old,Account_edit,ActivityLog,Address_STGtoODS_Address,Address_STGtoODS_Address_Old,Affiliation_CMtoATHENS_STGtoODS,BAV_ACCT_TERR_LOAD_DELTA ,BAV_BUS_ACNT_ALIGN,BAV_REP_ALIGN,BAV_UPDATE_TSF,CALL2_SAMPLE复制inMIG,CALL_OUTBOUND_DELETE,CA_CIRCULO_INTERFACE_REPL_OBJ,CA_CIRCULO_REPL_ACCOUNT,CA_CIRCULO_REPL_ADDRESS,CA_CIRCULO_REPL_CALL,CA_CIRCULO_REPL_CALLSAMPLE,CA_CIRCULO_REPL_PRODUCTCATALOG,CA_CIRCULO_REPL_USER ,CEG_ACCOUNT_UPDATE,CEG_ACCOUNT_UPDATE1,CI_Agra_Samples_FF_STG,CM_US_REPLtoFF_ACCOUNT,CM_US_REPLtoFF_ADDRESS,CM_US_REPLtoFF_CHILD_ACCOUNT,CM_US_REPLtoFF_CHILD_ACCOUNT_Test,CUSTOM_INTEGRATION_TEST,Agra_Account_Merge_Id,Agra_Samples_FF_to_STG1,Agra_Samples_Product_OB,Agra_Samples_STG1_to_STG2, Agra_Samples_User_OB,同意,Corp_BI_NZ_OR,Corp_BI_SYC_ORA_NTZ,CyclePlan,CyclePlan详情,CyclePlan详细UPD,CyclePlan TG,CyclePlan UPD,DELETE_ACCOUNT_FILT_NUCLEUS,DELETE_LOV_REPOSITORY, DELETE_TIME_OFF_TERITTORY,DEL_EVNT_ATND卖苦力,Filewatcher测试,MOD ACCT TERR LOADER DELTA ORM,MOD ACCT TERR LOADER DELTA ORM W2,MOD ACCT TERR洛德CP NORM ORM,MOD ACCT TERR洛德CP NORM ORM W2,MOD ACCT领土LOADER NORM ORM,MOD ACCT领土LOADER NORM ORM W2,MOD ATL NULL UPDATE_ORM,MOD ATL NULL UPDATE_ORM_W2,MOD帐户Terty装载机Sync_ORM,MOD账户Terty装载机Sync_ORM_W2,MOD砖TERR数据清理ORM,MOD砖TERR数据清理ORM W2,MOD TA ACCT TERR LOADER COMB ORM,MOD TA ACCT TERR LOADER COMB ORM W2,MOD TA呼唤SP SYNC ORM,MOD TA致电SP SYNC ORM W2,MOD TA COUNTRY欧盟ORM,MOD TA COUNTRY欧盟ORM_W2,MOD TA周期计划电中心ORM,MOD TA周期计划电中心ORM W2,MOD TA RULE DELIMIT ORM,MOD TA RULE DELIMIT ORM W2,MOD TA RULE分裂同步ORM,MOD TA RULE分裂同步ORM W2,MOD TA用户NOTIFICATION_ORM,MOD TA USER NOTIFICATION_ORM_W2,MOD_CEG_ACCNTRELATIONS_INBOUND,MOD_CEG_ACCNTRELATIONS_INBOUND_2,MOD_CEG_ADDR_DEL,MOD_CEG_AFFILIATIONS_INBOUND,MOD_CEG_CHILD_ACNT_DEL,MOD_CEG_Child_Account_PRIM_UNCHECK,MOD_CEG_ codes_INBOUND,MOD_CEG_INDIVIDUALADDR_INBOUND,MOD_CEG_INDIVIDUAL_INBOUND,MOD_CEG_Interest_Inbound,MOD_CEG_Organisation_INBOUND MOD_CEG_Organisation_NAME_UPD,MOD_CEG_REPL_ACCOUNT,MOD_CEG_REPL_ACCOUNT_2,MOD_CEG_REPL_ACCOUNT_GROUP,MOD_CEG_REPL_ACCOUNT_PLAN_ACCOUNT_GROUP,MOD_CEG_REPL_ADDRESS,MOD_CEG_REPL_CALL2_VOD,MOD_CEG_REPL_CHILD_ACCOUNT,MOD_CEG_REPL_LOV,MOD_CEG_REPL_Medical_EVENT_VOD,MOD_CEG_REPL_QUESTION,MOD_CEG_REPL_QUESTION_RESPONSE, MOD_CEG_REPL_RECORDTYPE,MOD_CEG_REPL_SHR_MEETING_COST,MOD_CEG_REPL_SURVEY,MOD_CEG_REPL_SURVEY_QUESTION,MOD_CEG_REPL_SURVEY_TARGET,MOD_CEG_Roles_INBOUND,MOD_CEG_Speciality_Inbound,MOD_CEG_Title_INBOUND,MOD_CEG_VAL_REQ_REPL,MOD_CEG_WORKPLACEADDR_INBOUND,MOD_CYCLE_PLAN_TARGETS,MOD_INDI_ADDRESS_DELETE,MOD_IND_ADDRESS MOD_IND_ADDR_UPD,MOD_INT_ORM_SYNC_TRACKING,MOD_INT_ORM_REPL_INTERFACE_OBJ_DLY,MOD_INT_ORM_REPL_INTERFACE_OBJ_DLY_W2,MOD_INT_ORM_REPL_OTHER_OBJECTS_DLY,MOD_INT_ORM_REPL_OTHER_OBJECTS_DLY_W2,MOD_INT_ORM_REPL_SFDC_DM,MOD_INT_ORM_SYNC_DM_CALL,MOD_INT_ORM_SYNC_DM_CALL_DETAIL,MOD_INT_ORM_SYNC_DM_CALL_KEY_MESSAGE,MOD_INT_ORM_SYNC_DM_CALL_SAMPLES,MOD_INT_ORM_SYNC_DM_CYCLE_PLAN, MOD_INT_ORM_SYNC_DM_CYCLE_PLAN_DETAIL,MOD_INT_ORM_SYNC_DM_CYCLE_PLAN_TARGET,MOD_INT_REPL_INTERFACE,MOD_INT_REPL_INTERFACE_OBJ_DLY_BKP1,MOD_INT_REPL_INTERFACE_OBJ_DLY_Dummy,MOD_INT_REPL_INTERFACE_OBJ_DLY_TEST1,MOD_INT_REPL_USER,MOD_INT_SYNC_CALLS,MOD_INT_SYNC_CALLS_SAMPLE,MOD_INT_SYNC_CALLS_STATUS_UPD,MOD_MIG_REPL_Account,MOD_MIG_REPL_Account_2,MOD_MIG_REPL_Questions MOD_MIG_REPL_Survey_Questuions,MOD_MIG_REPL_Survey_Targets,MOD_MIG_REPL_Surveys,MOD_MIG_SYNC_CONSENT,MOD_MIG_SYNC_QUESTION,MOD_MIG_SYNC_QUESTION_RESP,MOD_MIG_SYNC_SURVEY,MOD_MIG_SYNC_SURVEY_QUESTIONS,MOD_MIG_SYNC_SURVEY_TARGET,MOD_MIG_SYNC_User,MOD_SYNC_BALA_ACCOUNT2,MOD_TA_ERROR_LOGIC ORM, MOD_TA_ERROR_LOGIC ORM W2,MOD_BALA,MOD_BALA_2,MOD_BALA_ACCOUNT,MOD_BALA_CYCLE_PLAN,MOD_BALA_OUTFILE,MOD_BALA_OUTFILE_2,SHANKAR,SHANKAR_ALL_COLS,SHANKAR_MIGRATE_TEST,SHANKAR_SYNC_TEST,JP_CLEANUP_ACCOUNT_CYCLE1_SYNC, JP_CLEANUP_ADDRESS_CYCLE1_SYNC,JP_CLEANUP_CALL2_CYCLE1_SYNC,JP_CLEANUP_CHILD_CYCLE1_SYNC,JP_CLEANUP_CYCLE1_REPL,JP_UPD_BF_CLEANUP_CALL2_CYCLE1_SYNC,JP_UPD_BF_CLEANUP_CALL2_CYCLE1_SYNC_2,登录,Logon_REST,Migration_Test,新,OUS_ATHENS_REPL,PC_STG_ADDRESS_to_ODS_ADDRESS_Test,PC_US_FFtoSTG_CM_Dedupe_Xref ,PC_US_FFtoSTG_MDS_Territory_Alignment,PC_US_IBtoIB_CM_Cust_Xref_MIX,PC_US_IBtoOB_ATL_MigData,PC_US_IBtoOB_ATL_RawData,PC_US_IBtoOB_CyclePlan_Ups,PC_US_IBtoOB_CyclePlnDtl_Ups,PC_US_IBtoOB_CyclePlnTgt_Ups,PC_US_IBtoOB_TSF_Upsert,PC_US_MDS_FFtoSTG_Call_Guidance,PC_US_MDS_FFtoSTG_Call_Guidance_ADHD,PC_US_MDS_FFtoSTG_Call_Guidance_GI,PC_US_REPLtoSTG_Terr_Temp, PC_US_RepltoOB_CyclePln_GetID,Pattern_test,REPL_SPL_REC_ACCNTTYPE,Repl_BAV_mig1todev,SPL_CHR_FF2STG,SPL_CHR_REPL2FF,SPL_CHR_STG2ODS,Shyam_test,测试作业,测试REPL,TEST_1,Test_account_replciation, ENG_Attachment,ENG_Attachment_Oracle_to_Oracle,ENG_Attachment_REPL_CLOBtoBlob,ENG_CONV_Account_ISDELETED_UPD,ENG_CONV_Account_ISDELETED_UPD_2,ENG_CONV_Attachment_ISDELETED_UPD,ENG_CONV_Contact_ISDELETED_UPD,ENG_CONV_IW_CONSENT_UPD,ENG_CONV_Infusion_training_ISDELETED_UPD,ENG_CONV_PATIENT_ADDRESS_TO_SFDC_ADDRESS,ENG_CONV_PATIENT_CASE_UPDATE,ENG_CONV_PATIENT_CONTACT_TO_SFDC_CONTACT,ENG_CONV_PATIENT_CONTACT_UPDATE ,ENG_CONV_PATIENT_TO_SFDC_CONTACT_2,ENG_CONV_TO_SFDC_ACCOUNT,ENG_CONV_Task_ISDELETED_UPD,ENG_CONV_US_PM_Address_ISDELETED_UPD,ENG_CONV_US_PM_Case_DMODosition_ISDELETED_UPD,ENG_CONV_US_PM_Patient_Caregiver_ISDELETED_UPD,ENG_CONV_US_PM_Patient_Case_ISDELETED_UPD,ENG_CONV_US_PM_Patient_Consent_ISDELETED_UPD,ENG_CONV_US_PM_Patient_Physician_ISDELETED_UPD,ENG_CONV_US_PM_Patient_Product_ISDELETED_UPD,ENG_CONV_US_PM_Patient_Product_Shipment_ISDELETED_UPD,ENG_CONV_US_PM_Patient_Site_Of_Care_ISDELETED_UPD, ENG_CONV_US_PM_Service_Request_ISDELETED_UPD,ENG_CONV_Z_SFDC_ACCOUNT_PATIENT_SOC_TO_SFDC_ACCOUNT_LEGACYID_UPD,ENG_CONV_Z_SFDC_ACCOUNT_PATIENT_SOC_TO_SFDC_ACCOUNT_UPSERT,ENG_CONV_Z_SFDC_ACCOUNT_PAYER_TO_SFDC_ACCOUNT_LEGACYID_UPD,ENG_CONV_Z_SFDC_ACCOUNT_PAYER_TO_SFDC_ACCOUNT_UPSERT,ENG_CONV_Z_SFDC_ACCOUNT_PHYSICIAN_SOC_TO_SFDC_ACCOUNT_UPSERT,ENG_CONV_Z_SFDC_ACCOUNT_SOC_TO_SFDC_ACCOUNT_LEGACYID_UPD,ENG_CONV_Z_SFDC_ACCOUNT_SOC_TO_SFDC_ACCOUNT_UPSERT,ENG_CONV_Z_SFDC_ADDITIONAL_SOC_TO_SFDC_Additional_Site_of_Care__c_LEGACYID_UPD,ENG_CONV_Z_SFDC_ADDITIONAL_SOC_TO_SFDC_Additional_Site_of_Care__c_UPSERT,ENG_CONV_Z_SFDC_ADDRESS_TO_SFDC_US_PM_ADDRESS_INSERT,ENG_CONV_Z_SFDC_ATTACHEMENT_TO_SFDC_ATTACHEMENT_INSERT,ENG_CONV_Z_SFDC_ATTACHEMENT_TO_SFDC_ATTACHEMENT_INSERT_64KB ,ENG_CONV_Z_SFDC_ATTACHEMENT_TO_SFDC_ATTACHEMENT_INSERT_Test,ENG_CONV_Z_SFDC_CONTACT_CAREGIVER_TO_SFDC_CONTACT_LEGACYID_UPD,ENG_CONV_Z_SFDC_CONTACT_CAREGIVER_TO_SFDC_CONTACT_UPSERT,ENG_CONV_Z_SFDC_CONTACT_PATIENT_TO_SFDC_CONTACT_LEGACYID_UPD,ENG_CONV_Z_SFDC_CONTACT_PATIENT_TO_SFDC_CONTACT_UPSERT,ENG_CONV_Z_SFDC_CONTACT_PHYSICIAN_TO_SFDC_CONTACT_LEGACYID_UPD,ENG_CONV_Z_SFDC_CONTACT_PHYSICIAN_TO_SFDC_CONTACT_UPSERT,ENG_CONV_Z_SFDC_CONTACT_UPD_PRODUCT,ENG_CONV_Z_SFDC_INFUSION_TRAINING_TO_SFDC_INFUSION_TRAINING_INSERT,ENG_CONV_Z_SFDC_PATIENT_CAREGIVER_TO_SFDC_PATIENT_CAREGIVER_LEGACYID_UPD,ENG_CONV_Z_SFDC_PATIENT_CAREGIVER_TO_SFDC_PATIENT_CAREGIVER_UPSERT,ENG_CONV_Z_SFDC_PATIENT_CONSENT_TO_SFDC_US_PM_Patient_Consent__c_INSERT, ENG_CONV_Z_SFDC_PATIENT_PHYSICAN_TO_SFDC_PATIENT_PHYSICIAN_LEGACYID_UPD,ENG_CONV_Z_SFDC_PATIENT_PHYSICAN_TO_SFDC_PATIENT_PHYSICIAN_UPSERT,ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_INSERT,ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_INSERT_BATCH1,ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_INSERT_BATCH50,ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_INSERT_old,ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_UPSERT,ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_UPSERT_1,ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_UPSERT_2,ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_UPSERT_3,ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_UPSERT_4,ENG_CONV_Z_SFDC_PATIENT_SOC_TO_SFDC_PATIENT_SOC_LEGACYID_UPD,ENG_CONV_Z_SFDC_PATIENT_SOC_TO_SFDC_PATIENT_SOC_UPSERT ,ENG_CONV_Z_SFDC_TASK_CYCLE_TO_SFDC_TASK_INSERT,ENG_CONV_Z_SFDC_TASK_EVENT_TO_SFDC_TASK_INSERT,ENG_CONV_Z_SFDC_TASK_EVENT_TO_SFDC_TASK_INSERT_SQ,ENG_CONV_Z_SFDC_US_PM_CASE_DMODOSITION_TO_SFDC_CASE_DMODOSITION_INSERT,ENG_CONV_Z_SFDC_US_PM_PATIENT_CASE_TO_SFDC_PATIENT_CASE_UPSERT,ENG_CONV_Z_SFDC_US_PM_PATIENT_PRODUCT_TO_SFDC_PATIENT_PRODUCT_UPD,ENG_CONV_Z_SFDC_US_PM_SERVICE_REQUEST_TO_SFDC_SERVICE_REQUEST_INSERT,ENG_MDM_IB_ACCOUNT_INS,ENG_MDM_IB_ACCOUNT_UPD,ENG_MDM_IB_ADDITIONAL_SOC_INS,ENG_MDM_IB_CONTACT_INS,ENG_MDM_IB_CONTACT_UPD, ENG_MDM_IB_DUMMY_ACCOUNT_INS,ENG_MDM_IB_IDENTIFIER_ACCOUNT_UPD,ENG_MDM_IB_IDENTIFIER_CONTACT_UPD,ENG_MDM_OB_DATA_STD_LASTNAME,ENG_MDM_OB_DATA_STD_SPECIALTY,ENG_MDM_OB_DATA_STD_SUFFIX,ENG_SFDCINT_ODS_SFDC_REPL_ACCOUNT,ENG_SFDC_CONTACT_TO_CNTRL_SFDC_CONTACT,ENG_SFDC_TO_ODS_SFDC_REPL_ACCOUNT,ENG_SFDC_TO_ODS_SFDC_REPL_ACTION_ITEM,ENG_SFDC_TO_ODS_SFDC_REPL_Account_Partner,ENG_SFDC_TO_ODS_SFDC_REPL_Account_Share,ENG_SFDC_TO_ODS_SFDC_REPL_Account_Team_Member ,ENG_SFDC_TO_ODS_SFDC_REPL_Additional_Attendee,ENG_SFDC_TO_ODS_SFDC_REPL_Additional_Site_of_Care,ENG_SFDC_TO_ODS_SFDC_REPL_Address,ENG_SFDC_TO_ODS_SFDC_REPL_Admin_Country_Region,ENG_SFDC_TO_ODS_SFDC_REPL_Asset,ENG_SFDC_TO_ODS_SFDC_REPL_Attachment,ENG_SFDC_TO_ODS_SFDC_REPL_Awards_and_Honors,ENG_SFDC_TO_ODS_SFDC_REPL_Books_and_Monographs,ENG_SFDC_TO_ODS_SFDC_REPL_CONCEPT_BRIEF,ENG_SFDC_TO_ODS_SFDC_REPL_Campaign,ENG_SFDC_TO_ODS_SFDC_REPL_Campaign_Member,ENG_SFDC_TO_ODS_SFDC_REPL_Case, ENG_SFDC_TO_ODS_SFDC_REPL_Case_Comment,ENG_SFDC_TO_ODS_SFDC_REPL_Case_Contact_Role,ENG_SFDC_TO_ODS_SFDC_REPL_Case_DMODosition,ENG_SFDC_TO_ODS_SFDC_REPL_Case_Solution,ENG_SFDC_TO_ODS_SFDC_REPL_Case_Team_Member,ENG_SFDC_TO_ODS_SFDC_REPL_Clinical_Trials,ENG_SFDC_TO_ODS_SFDC_REPL_Committees,ENG_SFDC_TO_ODS_SFDC_REPL_Competitor,ENG_SFDC_TO_ODS_SFDC_REPL_Contact,ENG_SFDC_TO_ODS_SFDC_REPL_Contact_1,ENG_SFDC_TO_ODS_SFDC_REPL_Contact_2,ENG_SFDC_TO_ODS_SFDC_REPL_Contract,ENG_SFDC_TO_ODS_SFDC_REPL_Country ,ENG_SFDC_TO_ODS_SFDC_REPL_Customer_Business_Plan,ENG_SFDC_TO_ODS_SFDC_REPL_DASHBOARD,ENG_SFDC_TO_ODS_SFDC_REPL_DASHBOARD_COMPONENT,ENG_SFDC_TO_ODS_SFDC_REPL_De-Identified_Patient,ENG_SFDC_TO_ODS_SFDC_REPL_Dropped_Item,ENG_SFDC_TO_ODS_SFDC_REPL_Editorial_Boards,ENG_SFDC_TO_ODS_SFDC_REPL_Educational_Activity,ENG_SFDC_TO_ODS_SFDC_REPL_Event],\r
组:2\r
};\r
$ scope.tableFilter = {};\r
$ scope.namingConventionParams =新ngTableParams({\r
页面:1,//显示第一页\r
数:20,\r
文件管理器:$ scope.tableFilter\r
},{\r
defaultSort:ASC\r
总:数据$ scope.items.instanceData.length,//长度\r
罪状:[],\r
的getData:函数($延迟,则params){\r
变种reverceOrder = params.orderBy()及&放大器; params.orderBy()长度GT。 0安培;&安培; params.orderBy()[0] .indexOf(' - ')GT; -1;\r
VAR orderedData = params.sorting()? $过滤器('排序依据')($ scope.items.instanceData的valueOf()',reverceOrder):$ scope.items.instanceData;\r
orderedData = $ scope.tableFilter? $过滤器('过滤器')(orderedData,$ scope.tableFilter.text):orderedData;\r
$ scope.task_data = orderedData;\r
$ scope.task_data = orderedData.slice((params.page() - 1)* params.count(),params.page()* params.count());\r
params.total(orderedData.length);\r
$ defer.resolve($ scope.task_data);\r
}\r
});\r
});
\r
<链接HREF =https://cdnjs.cloudflare.com/ajax /libs/ng-table/0.3.3/ng-table.min.css的rel =stylesheet属性/>\r
<链接HREF =https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css的rel =stylesheet属性/>\r
&所述; SCRIPT SRC =https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js>&下; /脚本>\r
&所述; SCRIPT SRC =https://cdnjs.cloudflare.com/ajax/libs/ng-table/0.3.3/ng-table.min.js>&下; /脚本>\r
< DIV NG-应用=主NG控制器=DemoCtrl>\r
< H1> {{items.title}}< / H1>\r
< DIV CLASS =COL-MD-12>\r
<形式的作用=搜索级=导航栏,导航栏的形式左>\r
< DIV CLASS =表单组>\r
<输入类型=文本占位符=搜索级=的形式控制搜索输入框NG模型=tableFilter ['文字']/>\r
< / DIV>\r
< /表及GT;\r
< / DIV>\r
<表类=表NG表=namingConventionParams>\r
<&TBODY GT;\r
< TR NG重复=的rowIndex 0 |范围:$ data.length / 2NG-的init =rangeSize = $ data.length / 2>\r
< TD风格=字突破:突破一切数据标题=items.tableHeaderalign =left过滤器={'0':'文字'}排序='的valueOf()' > {{$数据[rowIndex位置]}}< / TD>\r
< TD风格=字突破:突破一切数据标题=items.tableHeaderalign =left过滤器={'0':'文字'}排序='的valueOf()' > {{$数据[rowIndex位置+ rangeSize]}}< / TD>\r
< / TR>\r
< / TBODY>\r
< DIV>
\r
I have 1000+ data and I need to place it in a ngTable but instead of 1 column I need to split this data into multiple columns, say 2, with filters and pagination after 20 items. Is it possible with ngTable?
For example: I have 100 items. On 1st page I will have 1st 20 items on 1st column and 2nd 20 items in 2nd column.
Below is my template
<div class="col-md-12">
<form role="search" class="navbar-form navbar-left">
<div class="form-group">
<input type="text" placeholder="Search" class="form-control search-inputbox" ng-model="namingConventionSearchText" />
</div>
</form>
</div>
<table class="table" ng-table="namingConventionParams">
<tr ng-repeat="item in items.instanceData | filter:namingConventionSearchText">
<td style="word-break:break-all">{{item}}</td>
</tr>
</table>
Controller code
$scope.items = {
"title": "Task",
"instanceData": ["MOD_INT_REPL_INTERFACE_OBJ_DLY", "MOD_INT_REPL_INTERFACE_OBJ_DLY_test", "Test_By_Justin", "ENG_ATTACHMENT", "ENG_CONV_Z_SFDC_US_PM_PATIENT_CASE_TO_SFDC_PATIENT_CASE_INSERT", "ENG_CONV_Z_SFDC_US_PM_PATIENT_PRODUCT_TO_SFDC_PATIENT_PRODUCT_INSERT", "US_SYNC_ODS2ATHENS_ADDR_ATHENSID", "test", " US_VEVA_2_ODS_REPL_Customer_Maintenance", " US_VEVA_2_ODS_REPL_USER_TERR", "AAAA", "AAATEST5", "ACCT_VIS_ZIP_TO_TERR_FLTR", "ADDRESS_MERGE_PROC_TEST", "AGGSPEND_ODStoFF _WKLY", "ARA_USER_TERR", "Account_StgtoODS_Account", "Account_StgtoODS_Account_Old", "Account_edit", "ActivityLog", "Address_STGtoODS_Address", "Address_STGtoODS_Address_Old", "Affiliation_CMtoATHENS_STGtoODS", "BAV_ACCT_TERR_LOAD_DELTA", "BAV_BUS_ACNT_ALIGN", "BAV_REP_ALIGN", "BAV_UPDATE_TSF", "CALL2_SAMPLE replication inMIG", "CALL_OUTBOUND_DELETE", "CA_CIRCULO_INTERFACE_REPL_OBJ", "CA_CIRCULO_REPL_ACCOUNT", "CA_CIRCULO_REPL_ADDRESS", "CA_CIRCULO_REPL_CALL", "CA_CIRCULO_REPL_CALLSAMPLE", "CA_CIRCULO_REPL_PRODUCTCATALOG", "CA_CIRCULO_REPL_USER", "CEG_ACCOUNT_UPDATE", "CEG_ACCOUNT_UPDATE1", "CI_Agra_Samples_FF_STG", "CM_US_REPLtoFF_ACCOUNT", "CM_US_REPLtoFF_ADDRESS", "CM_US_REPLtoFF_CHILD_ACCOUNT", "CM_US_REPLtoFF_CHILD_ACCOUNT_Test", "CUSTOM_INTEGRATION_TEST", "Agra_Account_Merge_Id", "Agra_Samples_FF_to_STG1", "Agra_Samples_Product_OB", "Agra_Samples_STG1_to_STG2", "Agra_Samples_User_OB", "Consent", "Corp_BI_NZ_OR", "Corp_BI_SYC_ORA_NTZ", "CyclePlan", "CyclePlan Detail"]
};
$scope.namingConventionParams = new ngTableParams({
page: 1, // show first page
count: 10
}, {
defaultSort: "asc",
total: $scope.items.instanceData.length, // length of data
counts: [],
getData: function($defer, params) {
var orderedData = params.sorting() ? $filter('orderBy')($scope.items.instanceData, params.orderBy()) : $scope.items.instanceData;
orderedData = params.filter() ? $filter('filter')(orderedData, params.filter()) : orderedData;
$scope.task_data = orderedData;
$scope.task_data = orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count());
params.total(orderedData.length);
$defer.resolve($scope.task_data);
}
});
Update
Here is my plunker link.
First of all I would try to map my string array to an object array before binding to the ngTable That would feel more natural to the ngTable. Something like this ["string A", "string B"]
would map to [ { index: '0', text: 'string A'}, { index: '1', text: 'string B'}];
.
This is what I came up with in terms of a single string array split equally into two columns per page. Take note to the custom range filter I used:
var app = angular.module('main', ['ngTable'])
.filter('slice', function() {
return function(items, page, size) {
return items.slice((page - 1) * size, page * size);
}
})
.filter('range', function() {
return function(start, length) {
var range = [];
for(var i = start; i < start + length; i++) {
range.push(i);
}
return range;
}
})
.controller('DemoCtrl', function($scope, $filter, ngTableParams, $log) {
$scope.items = {
"title": "Task",
"tableHeader": "Items",
"instanceData": ["MOD_INT_REPL_INTERFACE_OBJ_DLY", "MOD_INT_REPL_INTERFACE_OBJ_DLY_test", "Test_By_Justin", "ENG_ATTACHMENT", "ENG_CONV_Z_SFDC_US_PM_PATIENT_CASE_TO_SFDC_PATIENT_CASE_INSERT", "ENG_CONV_Z_SFDC_US_PM_PATIENT_PRODUCT_TO_SFDC_PATIENT_PRODUCT_INSERT", "US_SYNC_ODS2ATHENS_ADDR_ATHENSID", "test", " US_VEVA_2_ODS_REPL_Customer_Maintenance", " US_VEVA_2_ODS_REPL_USER_TERR", "AAAA", "AAATEST5", "ACCT_VIS_ZIP_TO_TERR_FLTR", "ADDRESS_MERGE_PROC_TEST", "AGGSPEND_ODStoFF _WKLY", "ARA_USER_TERR", "Account_StgtoODS_Account", "Account_StgtoODS_Account_Old", "Account_edit", "ActivityLog", "Address_STGtoODS_Address", "Address_STGtoODS_Address_Old", "Affiliation_CMtoATHENS_STGtoODS", "BAV_ACCT_TERR_LOAD_DELTA", "BAV_BUS_ACNT_ALIGN", "BAV_REP_ALIGN", "BAV_UPDATE_TSF", "CALL2_SAMPLE replication inMIG", "CALL_OUTBOUND_DELETE", "CA_CIRCULO_INTERFACE_REPL_OBJ", "CA_CIRCULO_REPL_ACCOUNT", "CA_CIRCULO_REPL_ADDRESS", "CA_CIRCULO_REPL_CALL", "CA_CIRCULO_REPL_CALLSAMPLE", "CA_CIRCULO_REPL_PRODUCTCATALOG", "CA_CIRCULO_REPL_USER", "CEG_ACCOUNT_UPDATE", "CEG_ACCOUNT_UPDATE1", "CI_Agra_Samples_FF_STG", "CM_US_REPLtoFF_ACCOUNT", "CM_US_REPLtoFF_ADDRESS", "CM_US_REPLtoFF_CHILD_ACCOUNT", "CM_US_REPLtoFF_CHILD_ACCOUNT_Test", "CUSTOM_INTEGRATION_TEST", "Agra_Account_Merge_Id", "Agra_Samples_FF_to_STG1", "Agra_Samples_Product_OB", "Agra_Samples_STG1_to_STG2", "Agra_Samples_User_OB", "Consent", "Corp_BI_NZ_OR", "Corp_BI_SYC_ORA_NTZ", "CyclePlan", "CyclePlan Detail", "CyclePlan Detail UPD", "CyclePlan TG", "CyclePlan UPD", "DELETE_ACCOUNT_FILT_NUCLEUS", "DELETE_LOV_REPOSITORY", "DELETE_TIME_OFF_TERITTORY", "DEL_EVNT_ATND", "DUMMIES", "Filewatcher Test", "MOD ACCT TERR LOADER DELTA ORM", "MOD ACCT TERR LOADER DELTA ORM W2", "MOD ACCT TERR LODER CP NORM ORM", "MOD ACCT TERR LODER CP NORM ORM W2", "MOD ACCT TERRITORY LOADER NORM ORM", "MOD ACCT TERRITORY LOADER NORM ORM W2", "MOD ATL NULL UPDATE_ORM", "MOD ATL NULL UPDATE_ORM_W2", "MOD Account Terty Loader Sync_ORM", "MOD Account Terty Loader Sync_ORM_W2", "MOD BRICK TO TERR DATA CLEAN ORM", "MOD BRICK TO TERR DATA CLEAN ORM W2", "MOD TA ACCT TERR LOADER COMB ORM", "MOD TA ACCT TERR LOADER COMB ORM W2", "MOD TA CALLING SP SYNC ORM", "MOD TA CALLING SP SYNC ORM W2", "MOD TA COUNTRY EU ORM", "MOD TA COUNTRY EU ORM_W2", "MOD TA CYCLE PLAN POWER CENTER ORM", "MOD TA CYCLE PLAN POWER CENTER ORM W2", "MOD TA RULE DELIMIT ORM", "MOD TA RULE DELIMIT ORM W2", "MOD TA RULE SPLIT SYNC ORM", "MOD TA RULE SPLIT SYNC ORM W2", "MOD TA USER NOTIFICATION_ORM", "MOD TA USER NOTIFICATION_ORM_W2", "MOD_CEG_ACCNTRELATIONS_INBOUND", "MOD_CEG_ACCNTRELATIONS_INBOUND_2", "MOD_CEG_ADDR_DEL", "MOD_CEG_AFFILIATIONS_INBOUND", "MOD_CEG_CHILD_ACNT_DEL", "MOD_CEG_Child_Account_PRIM_UNCHECK", "MOD_CEG_Codes_INBOUND", "MOD_CEG_INDIVIDUALADDR_INBOUND", "MOD_CEG_INDIVIDUAL_INBOUND", "MOD_CEG_Interest_Inbound", "MOD_CEG_Organisation_INBOUND", "MOD_CEG_Organisation_NAME_UPD", "MOD_CEG_REPL_ACCOUNT", "MOD_CEG_REPL_ACCOUNT_2", "MOD_CEG_REPL_ACCOUNT_GROUP", "MOD_CEG_REPL_ACCOUNT_PLAN_ACCOUNT_GROUP", "MOD_CEG_REPL_ADDRESS", "MOD_CEG_REPL_CALL2_VOD", "MOD_CEG_REPL_CHILD_ACCOUNT", "MOD_CEG_REPL_LOV", "MOD_CEG_REPL_Medical_EVENT_VOD", "MOD_CEG_REPL_QUESTION", "MOD_CEG_REPL_QUESTION_RESPONSE", "MOD_CEG_REPL_RECORDTYPE", "MOD_CEG_REPL_SHR_MEETING_COST", "MOD_CEG_REPL_SURVEY", "MOD_CEG_REPL_SURVEY_QUESTION", "MOD_CEG_REPL_SURVEY_TARGET", "MOD_CEG_Roles_INBOUND", "MOD_CEG_Speciality_Inbound", "MOD_CEG_Title_INBOUND", "MOD_CEG_VAL_REQ_REPL", "MOD_CEG_WORKPLACEADDR_INBOUND", "MOD_CYCLE_PLAN_TARGETS", "MOD_INDI_ADDRESS_DELETE", "MOD_IND_ADDRESS", "MOD_IND_ADDR_UPD", "MOD_INT_ORM_SYNC_TRACKING", "MOD_INT_ORM_REPL_INTERFACE_OBJ_DLY", "MOD_INT_ORM_REPL_INTERFACE_OBJ_DLY_W2", "MOD_INT_ORM_REPL_OTHER_OBJECTS_DLY", "MOD_INT_ORM_REPL_OTHER_OBJECTS_DLY_W2", "MOD_INT_ORM_REPL_SFDC_DM", "MOD_INT_ORM_SYNC_DM_CALL", "MOD_INT_ORM_SYNC_DM_CALL_DETAIL", "MOD_INT_ORM_SYNC_DM_CALL_KEY_MESSAGE", "MOD_INT_ORM_SYNC_DM_CALL_SAMPLES", "MOD_INT_ORM_SYNC_DM_CYCLE_PLAN", "MOD_INT_ORM_SYNC_DM_CYCLE_PLAN_DETAIL", "MOD_INT_ORM_SYNC_DM_CYCLE_PLAN_TARGET", "MOD_INT_REPL_INTERFACE", "MOD_INT_REPL_INTERFACE_OBJ_DLY_BKP1", "MOD_INT_REPL_INTERFACE_OBJ_DLY_Dummy", "MOD_INT_REPL_INTERFACE_OBJ_DLY_TEST1", "MOD_INT_REPL_USER", "MOD_INT_SYNC_CALLS", "MOD_INT_SYNC_CALLS_SAMPLE", "MOD_INT_SYNC_CALLS_STATUS_UPD", "MOD_MIG_REPL_Account", "MOD_MIG_REPL_Account_2", "MOD_MIG_REPL_Questions", "MOD_MIG_REPL_Survey_Questuions", "MOD_MIG_REPL_Survey_Targets", "MOD_MIG_REPL_Surveys", "MOD_MIG_SYNC_CONSENT", "MOD_MIG_SYNC_QUESTION", "MOD_MIG_SYNC_QUESTION_RESP", "MOD_MIG_SYNC_SURVEY", "MOD_MIG_SYNC_SURVEY_QUESTIONS", "MOD_MIG_SYNC_SURVEY_TARGET", "MOD_MIG_SYNC_User", "MOD_SYNC_BALA_ACCOUNT2", "MOD_TA_ERROR_LOGIC ORM", "MOD_TA_ERROR_LOGIC ORM W2", "MOD_BALA", "MOD_BALA_2", "MOD_BALA_ACCOUNT", "MOD_BALA_CYCLE_PLAN", "MOD_BALA_OUTFILE", "MOD_BALA_OUTFILE_2", "SHANKAR", "SHANKAR_ALL_COLS", "SHANKAR_MIGRATE_TEST", "SHANKAR_SYNC_TEST", "JP_CLEANUP_ACCOUNT_CYCLE1_SYNC", "JP_CLEANUP_ADDRESS_CYCLE1_SYNC", "JP_CLEANUP_CALL2_CYCLE1_SYNC", "JP_CLEANUP_CHILD_CYCLE1_SYNC", "JP_CLEANUP_CYCLE1_REPL", "JP_UPD_BF_CLEANUP_CALL2_CYCLE1_SYNC", "JP_UPD_BF_CLEANUP_CALL2_CYCLE1_SYNC_2", "Login", "Logon_REST", "Migration_Test", "New", "OUS_ATHENS_REPL", "PC_STG_ADDRESS_to_ODS_ADDRESS_Test", "PC_US_FFtoSTG_CM_Dedupe_Xref", "PC_US_FFtoSTG_MDS_Territory_Alignment", "PC_US_IBtoIB_CM_Cust_Xref_MIX", "PC_US_IBtoOB_ATL_MigData", "PC_US_IBtoOB_ATL_RawData", "PC_US_IBtoOB_CyclePlan_Ups", "PC_US_IBtoOB_CyclePlnDtl_Ups", "PC_US_IBtoOB_CyclePlnTgt_Ups", "PC_US_IBtoOB_TSF_Upsert", "PC_US_MDS_FFtoSTG_Call_Guidance ", "PC_US_MDS_FFtoSTG_Call_Guidance_ADHD", "PC_US_MDS_FFtoSTG_Call_Guidance_GI", "PC_US_REPLtoSTG_Terr_Temp", "PC_US_RepltoOB_CyclePln_GetID", "Pattern_test", "REPL_SPL_REC_ACCNTTYPE", "Repl_BAV_mig1todev", "SPL_CHR_FF2STG", "SPL_CHR_REPL2FF", "SPL_CHR_STG2ODS", "Shyam_test", "Test Job", "Test Repl", "Test_1", "Test_account_replciation", "ENG_Attachment", "ENG_Attachment_Oracle_to_Oracle", "ENG_Attachment_REPL_CLOBtoBlob", "ENG_CONV_Account_ISDELETED_UPD", "ENG_CONV_Account_ISDELETED_UPD_2", "ENG_CONV_Attachment_ISDELETED_UPD", "ENG_CONV_Contact_ISDELETED_UPD", "ENG_CONV_IW_CONSENT_UPD", "ENG_CONV_Infusion_training_ISDELETED_UPD", "ENG_CONV_PATIENT_ADDRESS_TO_SFDC_ADDRESS", "ENG_CONV_PATIENT_CASE_UPDATE", "ENG_CONV_PATIENT_CONTACT_TO_SFDC_CONTACT", "ENG_CONV_PATIENT_CONTACT_UPDATE", "ENG_CONV_PATIENT_TO_SFDC_CONTACT_2", "ENG_CONV_TO_SFDC_ACCOUNT", "ENG_CONV_Task_ISDELETED_UPD", "ENG_CONV_US_PM_Address_ISDELETED_UPD", "ENG_CONV_US_PM_Case_DMODosition_ISDELETED_UPD", "ENG_CONV_US_PM_Patient_Caregiver_ISDELETED_UPD", "ENG_CONV_US_PM_Patient_Case_ISDELETED_UPD", "ENG_CONV_US_PM_Patient_Consent_ISDELETED_UPD", "ENG_CONV_US_PM_Patient_Physician_ISDELETED_UPD", "ENG_CONV_US_PM_Patient_Product_ISDELETED_UPD", "ENG_CONV_US_PM_Patient_Product_Shipment_ISDELETED_UPD", "ENG_CONV_US_PM_Patient_Site_Of_Care_ISDELETED_UPD", "ENG_CONV_US_PM_Service_Request_ISDELETED_UPD", "ENG_CONV_Z_SFDC_ACCOUNT_PATIENT_SOC_TO_SFDC_ACCOUNT_LEGACYID_UPD", "ENG_CONV_Z_SFDC_ACCOUNT_PATIENT_SOC_TO_SFDC_ACCOUNT_UPSERT", "ENG_CONV_Z_SFDC_ACCOUNT_PAYER_TO_SFDC_ACCOUNT_LEGACYID_UPD", "ENG_CONV_Z_SFDC_ACCOUNT_PAYER_TO_SFDC_ACCOUNT_UPSERT", "ENG_CONV_Z_SFDC_ACCOUNT_PHYSICIAN_SOC_TO_SFDC_ACCOUNT_UPSERT", "ENG_CONV_Z_SFDC_ACCOUNT_SOC_TO_SFDC_ACCOUNT_LEGACYID_UPD", "ENG_CONV_Z_SFDC_ACCOUNT_SOC_TO_SFDC_ACCOUNT_UPSERT", "ENG_CONV_Z_SFDC_ADDITIONAL_SOC_TO_SFDC_Additional_Site_of_Care__c_LEGACYID_UPD", "ENG_CONV_Z_SFDC_ADDITIONAL_SOC_TO_SFDC_Additional_Site_of_Care__c_UPSERT", "ENG_CONV_Z_SFDC_ADDRESS_TO_SFDC_US_PM_ADDRESS_INSERT", "ENG_CONV_Z_SFDC_ATTACHEMENT_TO_SFDC_ATTACHEMENT_INSERT", "ENG_CONV_Z_SFDC_ATTACHEMENT_TO_SFDC_ATTACHEMENT_INSERT_64KB", "ENG_CONV_Z_SFDC_ATTACHEMENT_TO_SFDC_ATTACHEMENT_INSERT_Test", "ENG_CONV_Z_SFDC_CONTACT_CAREGIVER_TO_SFDC_CONTACT_LEGACYID_UPD", "ENG_CONV_Z_SFDC_CONTACT_CAREGIVER_TO_SFDC_CONTACT_UPSERT", "ENG_CONV_Z_SFDC_CONTACT_PATIENT_TO_SFDC_CONTACT_LEGACYID_UPD", "ENG_CONV_Z_SFDC_CONTACT_PATIENT_TO_SFDC_CONTACT_UPSERT", "ENG_CONV_Z_SFDC_CONTACT_PHYSICIAN_TO_SFDC_CONTACT_LEGACYID_UPD", "ENG_CONV_Z_SFDC_CONTACT_PHYSICIAN_TO_SFDC_CONTACT_UPSERT", "ENG_CONV_Z_SFDC_CONTACT_UPD_PRODUCT", "ENG_CONV_Z_SFDC_INFUSION_TRAINING_TO_SFDC_INFUSION_TRAINING_INSERT", "ENG_CONV_Z_SFDC_PATIENT_CAREGIVER_TO_SFDC_PATIENT_CAREGIVER_LEGACYID_UPD", "ENG_CONV_Z_SFDC_PATIENT_CAREGIVER_TO_SFDC_PATIENT_CAREGIVER_UPSERT", "ENG_CONV_Z_SFDC_PATIENT_CONSENT_TO_SFDC_US_PM_Patient_Consent__c_INSERT", "ENG_CONV_Z_SFDC_PATIENT_PHYSICAN_TO_SFDC_PATIENT_PHYSICIAN_LEGACYID_UPD", "ENG_CONV_Z_SFDC_PATIENT_PHYSICAN_TO_SFDC_PATIENT_PHYSICIAN_UPSERT", "ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_INSERT", "ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_INSERT_BATCH1", "ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_INSERT_BATCH50", "ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_INSERT_old", "ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_UPSERT", "ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_UPSERT_1", "ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_UPSERT_2", "ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_UPSERT_3", "ENG_CONV_Z_SFDC_PATIENT_PRODUCTSHIPMENT_TO_SFDC_US_PM_PATIENT_PRODUCT_SHIPMENT_UPSERT_4", "ENG_CONV_Z_SFDC_PATIENT_SOC_TO_SFDC_PATIENT_SOC_LEGACYID_UPD", "ENG_CONV_Z_SFDC_PATIENT_SOC_TO_SFDC_PATIENT_SOC_UPSERT", "ENG_CONV_Z_SFDC_TASK_CYCLE_TO_SFDC_TASK_INSERT", "ENG_CONV_Z_SFDC_TASK_EVENT_TO_SFDC_TASK_INSERT", "ENG_CONV_Z_SFDC_TASK_EVENT_TO_SFDC_TASK_INSERT_SQ", "ENG_CONV_Z_SFDC_US_PM_CASE_DMODOSITION_TO_SFDC_CASE_DMODOSITION_INSERT", "ENG_CONV_Z_SFDC_US_PM_PATIENT_CASE_TO_SFDC_PATIENT_CASE_UPSERT", "ENG_CONV_Z_SFDC_US_PM_PATIENT_PRODUCT_TO_SFDC_PATIENT_PRODUCT_UPD", "ENG_CONV_Z_SFDC_US_PM_SERVICE_REQUEST_TO_SFDC_SERVICE_REQUEST_INSERT ", "ENG_MDM_IB_ACCOUNT_INS", "ENG_MDM_IB_ACCOUNT_UPD", "ENG_MDM_IB_ADDITIONAL_SOC_INS", "ENG_MDM_IB_CONTACT_INS", "ENG_MDM_IB_CONTACT_UPD", "ENG_MDM_IB_DUMMY_ACCOUNT_INS", "ENG_MDM_IB_IDENTIFIER_ACCOUNT_UPD", "ENG_MDM_IB_IDENTIFIER_CONTACT_UPD", "ENG_MDM_OB_DATA_STD_LASTNAME", "ENG_MDM_OB_DATA_STD_SPECIALTY", "ENG_MDM_OB_DATA_STD_SUFFIX", "ENG_SFDCINT_ODS_SFDC_REPL_ACCOUNT", "ENG_SFDC_CONTACT_TO_CNTRL_SFDC_CONTACT", "ENG_SFDC_TO_ODS_SFDC_REPL_ACCOUNT", "ENG_SFDC_TO_ODS_SFDC_REPL_ACTION_ITEM", "ENG_SFDC_TO_ODS_SFDC_REPL_Account_Partner", "ENG_SFDC_TO_ODS_SFDC_REPL_Account_Share", "ENG_SFDC_TO_ODS_SFDC_REPL_Account_Team_Member", "ENG_SFDC_TO_ODS_SFDC_REPL_Additional_Attendee", "ENG_SFDC_TO_ODS_SFDC_REPL_Additional_Site_of_Care", "ENG_SFDC_TO_ODS_SFDC_REPL_Address", "ENG_SFDC_TO_ODS_SFDC_REPL_Admin_Country_Region", "ENG_SFDC_TO_ODS_SFDC_REPL_Asset", "ENG_SFDC_TO_ODS_SFDC_REPL_Attachment", "ENG_SFDC_TO_ODS_SFDC_REPL_Awards_and_Honors", "ENG_SFDC_TO_ODS_SFDC_REPL_Books_and_Monographs", "ENG_SFDC_TO_ODS_SFDC_REPL_CONCEPT_BRIEF", "ENG_SFDC_TO_ODS_SFDC_REPL_Campaign", "ENG_SFDC_TO_ODS_SFDC_REPL_Campaign_Member", "ENG_SFDC_TO_ODS_SFDC_REPL_Case", "ENG_SFDC_TO_ODS_SFDC_REPL_Case_Comment", "ENG_SFDC_TO_ODS_SFDC_REPL_Case_Contact_Role", "ENG_SFDC_TO_ODS_SFDC_REPL_Case_DMODosition", "ENG_SFDC_TO_ODS_SFDC_REPL_Case_Solution", "ENG_SFDC_TO_ODS_SFDC_REPL_Case_Team_Member", "ENG_SFDC_TO_ODS_SFDC_REPL_Clinical_Trials", "ENG_SFDC_TO_ODS_SFDC_REPL_Committees", "ENG_SFDC_TO_ODS_SFDC_REPL_Competitor", "ENG_SFDC_TO_ODS_SFDC_REPL_Contact", "ENG_SFDC_TO_ODS_SFDC_REPL_Contact_1", "ENG_SFDC_TO_ODS_SFDC_REPL_Contact_2", "ENG_SFDC_TO_ODS_SFDC_REPL_Contract", "ENG_SFDC_TO_ODS_SFDC_REPL_Country", "ENG_SFDC_TO_ODS_SFDC_REPL_Customer_Business_Plan", "ENG_SFDC_TO_ODS_SFDC_REPL_DASHBOARD", "ENG_SFDC_TO_ODS_SFDC_REPL_DASHBOARD_COMPONENT", "ENG_SFDC_TO_ODS_SFDC_REPL_De-Identified_Patient", "ENG_SFDC_TO_ODS_SFDC_REPL_Dropped_Item", "ENG_SFDC_TO_ODS_SFDC_REPL_Editorial_Boards", "ENG_SFDC_TO_ODS_SFDC_REPL_Educational_Activity", "ENG_SFDC_TO_ODS_SFDC_REPL_Event"],
groups: 2
};
$scope.tableFilter = {};
$scope.namingConventionParams = new ngTableParams({
page: 1, // show first page
count: 20,
filer: $scope.tableFilter
}, {
defaultSort: "asc",
total: $scope.items.instanceData.length, // length of data
counts: [],
getData: function($defer, params) {
var reverceOrder = params.orderBy() && params.orderBy().length > 0 && params.orderBy()[0].indexOf('-') > -1;
var orderedData = params.sorting() ? $filter('orderBy')($scope.items.instanceData, 'valueOf()', reverceOrder) : $scope.items.instanceData;
orderedData = $scope.tableFilter ? $filter('filter')(orderedData, $scope.tableFilter.text) : orderedData;
$scope.task_data = orderedData;
$scope.task_data = orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count());
params.total(orderedData.length);
$defer.resolve($scope.task_data);
}
});
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/ng-table/0.3.3/ng-table.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ng-table/0.3.3/ng-table.min.js"></script>
<div ng-app="main" ng-controller="DemoCtrl">
<h1>{{items.title}}</h1>
<div class="col-md-12">
<form role="search" class="navbar-form navbar-left">
<div class="form-group">
<input type="text" placeholder="Search" class="form-control search-inputbox" ng-model="tableFilter['text']" />
</div>
</form>
</div>
<table class="table" ng-table="namingConventionParams">
<tbody>
<tr ng-repeat="rowIndex in 0 | range : $data.length / 2" ng-init="rangeSize = $data.length / 2">
<td style="word-break:break-all" data-title="items.tableHeader" align="left" filter="{ '0': 'text' }" sortable="'valueOf()'">{{$data[rowIndex]}}</td>
<td style="word-break:break-all" data-title="items.tableHeader" align="left" filter="{ '0': 'text' }" sortable="'valueOf()'">{{$data[rowIndex + rangeSize]}}</td>
</tr>
</tbody>
<div>
这篇关于如何将数据分割成的ngtable多列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!