Template:ObjectSearchExample

    Table of contents
    No headers
    // + PARAMETERS
    var par = { 
        search_criteria: ($0 ?? __request.args.search_criteria ?? args.search_criteria ??  '' ),
        srcpath: ($1 ?? __request.args.srcpath ?? args.srcpath ..'/*' ),
    // ----- Change 'rs_ObjectSearchExemple' with 'rs_your_template_name'
        new_table_id: (__request.args.new_table_id ?? args.new_table_id ?? 'rs_ObjectSearchExemple'),
        ajax_action: String.tolower( __request.args.ajax_action ?? args.ajax_action ?? 'load')
       };
    
    if ((par.ajax_action=='load') || (par.ajax_action=='reload_ObjectSearchExample')) {
    // ----- Change "ObjectData_tag" with object's "tag"
     var sc = 'type:wiki AND tag:"ObjectData_tag"';
     if (par.search_criteria!='') {
        let sc ..= " AND ("..par.search_criteria..")"
       }
     let sc ..= ' -namespace:template';
    
     RecordSearch{
       // ----- Change 'data_table_div_id with ObjectData table DIV ID
          data_id: 'data_table_div_id',
          search_criteria: sc,
          new_table_id: par.new_table_id,
       // ----- Change "key_link" with the columns.key you whant to have a link to the ObjectData
          column_link_record: "key_link",
       // ----- Change "ObjectData_tag" with object's "tag", you can add as much as tags as you want 
       // ----- that don't apear on the page_tags key columng
          filter_tags: [ "ObjectData_tag"],
       // ----- You can do whatever can be done with columns TSTable parameter and also:
       // -----   * User special Key columns: 
       // -----            page_title: It shows the page.title as a field
       // -----            page_tgas: It shows the page.tags as a field
       // ----  The key values are the ObjectData Column 1 values
          columns: [
            { title: "Page Title",    key: "page_title" },
            { title: "Field 1",           key: "Field 1" },
            { title: "Field 2",     key: "Field 2" },
            { title: "Tags",        key: "page_tags" }
             ]
       }
     }
    
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by