Adjust the config file.

  • Put the config javascript file inside your page. Use only one config file.
  • This file must be placed before the Tbs Grid javascript files.
// Samples
<script src="/tbs.grid/tbs.grid.configs.js"></script>
// Tbs Grid
<script src="/tbsgrid/tbs.grid.min.js"></script>
  • Set up country-specific config files.
// Samples
tbsGridConfigs.en = {
    culture: {
        name: 'us',
        language: 'us',
        currencyChar: '$',
        decimalChar: '.',
        thousandChar: ',',
    },
    calendar: {
        dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
        dayShortNames: ['Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'],
        dayPattern: 'MM-dd-yyyy',
        months : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
        prevLinkName : 'prev',
        nextLinkName : 'next',
        todayLinkName: 'today'
    },
    font: {
        fontSize: '12px',
        fontFamily: 'Arial, Helvetica, sans-serif',
    },
    labels: {
        /* placeholder */
        sort_placeholder  : 'Drag columns to sort',
        group_placeholder : 'Drag columns to group',

        /* Filter Label */
        filter_select        : 'Select',
        filter_equal         : 'Equal',
        filter_notEqual      : 'Does not equal',
        filter_greater       : 'Greater than',
        filter_greaterEqual  : 'Greater than or Equal to',
        filter_less          : 'Less than',
        filter_lessEqual     : 'Less than or Equal to',
        filter_between       : 'Between',
        filter_blank         : 'Blank',
        filter_include 		 : 'Include',
        filter_notInclude 	 : 'Not Include',
        filter_startCharacter: 'Start Characters',
        filter_endCharacter	 : 'End Characters',

        /* Toolbar Label */
        toolbar_button_filter	  : 'Filter',
        toolbar_button_sorting	  : 'Sorting',
        toolbar_button_grouping   : 'Grouping',
        toolbar_button_expand   : 'Expand',
        toolbar_button_collapse : 'Collapse',
        toolbar_button_fixedColumn: 'Fixed Column',
        toolbar_button_reset	  : 'Reset',
    }
}
tbsGridConfigs.options = {
    imageRoot: 'https://cdn.jsdelivr.net/npm/tbsgrid@0.2.4/dist-js/img/',
    userImageRoot: '/src/img/',
    isMobile: /iPhone|iPad|iPod|Android/i.test(navigator.userAgent), // true, false
    userAgent: navigator.userAgent, // 'safari' etc
    trueValue  : 'Y', // checkbox value
    falseValue : 'N',
    elseValue  : 'N',
}
  • grid1.setGridConfig(tbsGridConfigs.en) is option.
  • You can set country-specific options. If there are no settings, the first item among the configs is automatically set.
// Examples
let grid1 = new TbsGrid('grid1');
grid1.setGridConfig(tbsGridConfigs.en); // Option.