Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
igGrid filtering - adjust row height and text box height and font
posted

I am building a grid with the following code: 

            $("#grdSearchGrid").igGrid({
                dataSource: gridData.Rows,
                primaryKey: "igGridPrimaryKey",
                autoGenerateColumns: false,
                width: "100%",
                columns: [
                    { headerText: 'igGridPrimaryKey', key: 'igGridPrimaryKey', dataType: 'number', width: '0%' },
                    {
                        headerText: "CLIENT ID", key: "ClientID", dataType: "string",
                        width: "10%",
                        template: "<span class='click-clientID' data-id='${ClientID}' style='text-align: left; display: block;'>${ClientID}</span>"
                    },
                    {
                        headerText: "FILE NUMBER", key: "FileNumber", dataType: "string",
                        width: "10%",
                        template: "<span class='click-filenumber' data-id='${FileNumber}' style='text-align: left; display: block;'>${FileNumber}</span>"
                    },
                    {
                        headerText: "COUNTY", key: "County", dataType: "string",
                        width: "7%",
                        template: "<span class='click-county' data-id='${County}' style='text-align: left; display: block;'>${County}</span>"
                    },
                    {
                        headerText: "CLIENT MATTER", key: "ClientMatter", dataType: "string",
                        width: "7%",
                        template: "<span class='click-clientmatter' data-id='${ClientMatter}' style='text-align: left; display: block;'>${ClientMatter}</span>"
                    },
                    {
                        headerText: "PETITIONER", key: "Petitioner", dataType: "string",
                        width: "17%",
                        template: "<span class='click-petitioner' data-id='${Petitioner}' style='text-align: left; display: block;'>${Petitioner}</span>"
                    },
                    {
                        headerText: "DISTRICT", key: "District", dataType: "string",
                        width: "7%",
                        template: "<span class='click-district' data-id='${District}' style='text-align: left; display: block;'>${District}</span>"
                    },
                    {
                        headerText: "SECTION", key: "Section", dataType: "string",
                        width: "7%",
                        template: "<span class='click-section' data-id='${Section}' style='text-align: left; display: block;'>${Section}</span>"
                    },
                    {
                        headerText: "BLOCK", key: "Block", dataType: "string",
                        width: "7%",
                        template: "<span class='click-block' data-id='${Block}' style='text-align: left; display: block;'>${Block}</span>"
                    },
                    {
                        headerText: "BLOCKEXT", key: "BlockExt", dataType: "string",
                        width: "7%",
                        template: "<span class='click-blockext' data-id='${BlockExt}' style='text-align: left; display: block;'>${BlockExt}</span>"
                    },
                    {
                        headerText: "LOT", key: "Lot", dataType: "string",
                        width: "7%",
                        template: "<span class='click-lot' data-id='${Lot}' style='text-align: left; display: block;'>${Lot}</span>"
                    },
                    {
                        headerText: "LOTEXT", key: "LotExt", dataType: "string",
                        width: "7%",
                        template: "<span class='click-lotext' data-id='${LotExt}' style='text-align: left; display: block;'>${LotExt}</span>"
                    },
                    {
                        headerText: "CONDO", key: "Condo", dataType: "string",
                        width: "7%",
                        template: "<span class='click-condo' data-id='${Condo}' style='text-align: left; display: block;'>${Condo}</span>"
                    }
                ],
                features: [
                    { name: "Filtering", type: "local" },
                    { name: "Sorting", type: "local" },
                    { name: "Paging", type: "local", pageSize: 100},
                    { name: "Selection", mode: "row", multipleSelection: false }
                ]
            });

The grid gets placed into this html container

                <div style="padding:15px" class="panel-body divBody">
                    <div id="gridContainer" style="max-height: 800px; overflow: auto;">
                        <div class="uk-flex uk-flex-row uk-width-1-1" id="divSearchClient">
                            <div class="uk-flex uk-flex-row uk-grid-row-collapse uk-grid-column-small" style="margin-top: 15px; margin-bottom:15px" uk-grid>
                                <table id="grdSearchGrid"></table>
                            </div>
                        </div>
                    </div>
                </div>

Is there a way to increase the height of the filtering row that igGrid builds at the top of the grid?  And if so, how can each of the text input boxes that a placed in the filter row be expanded to the same height?  And, how can the font size of the text that is entered in the input boxes be increased?

I thank you in advance for any assistance.

  • 660
    Offline posted

    Hello,

    Thank you for your question regarding adjusting the height and styling of the filtering row in your igGrid.

    To meet your requirements, you can apply custom CSS to override the default styling of the filter row and input boxes. Below are the key styles you'll need to adjust:

    /* Adjusts the height of the filter row and its input containers */
    .ui-iggrid-filterrow,
    .ui-igedit-container,
    .ui-igedit-container a {
      height: 45px !important;
    }
    
    /* Ensures proper vertical alignment of the input field */
    .ui-igedit-container a::before {
      position: relative !important;
      top: 0.5rem !important;
    }
    
    /* Increases the font size of the filter input text */
    .ui-igedit-input {
      font-size: 20px !important;
    }

    The described scenario could be observed here:

     

    I’ve also created a working example for you to review and test here:

    Live Demo - JSFiddle

    Please do not hesitate to contact me if you need any further assistance with this matter. 

    Regards,

    Georgi Anastasov

    Associate Software Developer

    Infragistics