ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: hyh888 on January 31, 2022, 11:10:53 am

Title: How to shrink size the delete button
Post by: hyh888 on January 31, 2022, 11:10:53 am
I have tried to shrink the size of delete button to reduce the height of every row, but got failed even tried many times.
Is there any solution for it?
Title: Re: How to shrink size the delete button
Post by: paramvir on January 31, 2022, 06:29:24 pm
Hope this helps to reduce the size of jQueryUI button.

https://stackoverflow.com/questions/2724041/how-do-you-size-the-jquery-button
Title: Re: How to shrink size the delete button
Post by: hyh888 on February 01, 2022, 03:52:41 am
This idea can do reduce the height of the button and make no trouble for row height, but the cissors icon is not in the middle vertically any more. My code is as follow:
             { title: "删除", editable: false, minWidth: 123, sortable: false,
               render: function (ui) {return "<button type='button' class='delete_btn'></button>";},
              postRender: function (ui) {
                  var rowIndx = ui.rowIndx,grid = this,$cell = grid.getCell(ui);
                 $cell.find("button").button({icons: { primary: 'ui-icon-scissors' }})//
                 .bind("click", function () {
                     grid.addClass({ rowIndx: ui.rowIndx, cls: 'pq-row-delete' });
                     setTimeout(function () {
                         var ans = window.confirm("确定要删除第 " + (rowIndx + 1) + "行吗?");
                         grid.removeClass({ rowIndx: rowIndx, cls: 'pq-row-delete' });
                         if (ans) {grid.deleteRow({ rowIndx: rowIndx });}
                     })
                    }).css({height:'15px'});
            }
           }