
{% extends "test_base.html" %} 

{% block main_header %}Test Table{% endblock %}


{% block body_content %}
          <wc-table     id="i_env_table_list" 
                        class="sck_config_validate" 
                        add_row="Add +"

                        submit_hidden_data='{"id":"access_key", "value":"112233" }' 
                        submit_on_del='/test/table/ajax_del'
                        submit_on_add='/test/table/ajax_add'
                        submit_on_edit='/test/table/ajax_edit'
                        popup_messages='{ "add_success":"added", "add_fail":"failed to add", 
                                          "edit_success":"edited", "edit_fail":"failed to edit", 
                                          "del_success":"deleted", "del_fail":"failed to delete" }'
                        popup_message_submit_success="added"
                        popup_message_submit_fail = "failed to add"

                        columns='[
                              {"col_label":"ID", "id":"si_env_id", "editable":"false", "hidden":"true","key_field":"true"},
                              {"col_label":"Name", "id":"si_env_name", "editable":"true"},
                              {"col_label":"Description", "id":"si_env_desc", "editable":"true" },
                              {"col_label":"Code", "id":"si_env_code", "editable":"true", "validation":{"text_min_len":4}  },
                              {"col_label":"Type", "id":"si_env_type", "editable":"true", "field_params":{"list":"file_type_list"}, "type":"select"  },
                              {"col_label":"Action", "id":"si_env_action", "type":"actions", "data-key":"ck_env_edit", "actions":["edit","delete"] }
                        ]'

                        field_params = '{
                          "file_type_list":{"log":"Log", "base":"Base Directory", "app":"App Directory",  "def":"Library Directory", "resdef":"Resource  Directory"}
                        }'

                        data='[ [ {"id":"si_env_id", "value":"1" },
                                  {"id":"si_env_name", "value":"Dev", "data-value":"1" },
                                  {"id":"si_env_desc", "value":"Development"},
                                  {"id":"si_env_code", "value":"dev"}  ] ,

                                [ {"id":"si_env_id", "value":"2"  },
                                  {"id":"si_env_name", "value":"Dev",  "data-value":"2"  },
                                  {"id":"si_env_desc", "value":"Development"},
                                  {"id":"si_env_code", "value":"dev"} ] ,

                                [ {"id":"si_env_id", "value":"3"  },
                                  {"id":"si_env_name", "value":"Dev", "data-value":"3"},
                                  {"id":"si_env_desc", "value":"Development"},
                                  {"id":"si_env_code", "value":"dev"} ] 
                              ]'

                        >

          <!-- <i class="far fa-edit"></i> -->

          </wc-table>



        <wc-table     id="i_env_table_list" 
                            class="sck_config_validate" 
                            add_row="Add +"

                            xxx_submit_hidden_data='{"id":"access_key", "value":"112233" }' 
                            submit_on_del='/test/table/ajax_del'
                            submit_on_add='/test/table/ajax_add'
                            submit_on_edit='/test/table/ajax_edit'
                            popup_messages='{ "add_success":"added", "add_fail":"failed to add", 
                                              "edit_success":"edited", "edit_fail":"failed to edit", 
                                              "del_success":"deleted", "del_fail":"failed to delete" }'
                            popup_message_submit_success="added"
                            popup_message_submit_fail = "failed to add"

                            columns='[
                                  {"col_label":"ID", "id":"si_env_id", "editable":"false", "hidden":"true","key_field":"true"},
                                  {"col_label":"Name", "id":"si_env_name", "editable":"true"},
                                  {"col_label":"Description", "id":"si_env_desc", "editable":"true" },
                                  {"col_label":"Code", "id":"si_env_code", "editable":"true", "validation":{"text_min_len":4}  },
                                  {"col_label":"Action", "id":"si_env_action", "type":"actions", "data-key":"ck_env_edit", "actions":["edit","delete"] }
                            ]'

                            data='[ [ {"id":"si_env_id", "value":"1" },
                                     {"id":"si_env_name", "value":"Dev", "data-value":"1" },
                                                          {"id":"si_env_desc", "value":"Development"},
                                                          {"id":"si_env_code", "value":"dev"} 
                                                        ] ,
                                    [ {"id":"si_env_id", "value":"2"  },
                                     {"id":"si_env_name", "value":"Dev",  "data-value":"2"  },
                                                          {"id":"si_env_desc", "value":"Development"},
                                                          {"id":"si_env_code", "value":"dev"} 
                                                        ] ,
                                    [  {"id":"si_env_id", "value":"3"  },
                                    {"id":"si_env_name", "value":"Dev", "data-value":"3"},
                                                          {"id":"si_env_desc", "value":"Development"},
                                                          {"id":"si_env_code", "value":"dev"} 
                                                        ] 
                                  ]'

                        >
                        
                        <!-- <i class="far fa-edit"></i> -->
       
        </wc-table>

{% endblock %}


{% block page_script %}
  <script>
    
    document.addEventListener('DOMContentLoaded', function () {
       
    });

  </script>
  <!-- <script  src="/common/st/_def/common/static/_def/js/common_utils.js"></script>  -->
  <script type="module" src="/webui/static/zwc/wc_form_input.js"></script> 
  <script type="module" src="/webui/static/zwc/wc_tab.js"></script> 
  <!-- <script type="module" src="/webui/static/zwc/wc_panel.js"></script>  -->
  <script type="module" src="/webui/static/zwc/wc_table.js"></script> 
  <script type="module" src="/webui/static/zwc/wc_form_checkbox.js"></script> 
  <script type="module" src="/webui/static/zwc/wc_modal.js"></script> 
  <script type="module" src="/webui/static/zwc/wc_form_radio.js"></script> 


{% endblock %}