bestaru

Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • in reply to: Possible error after beforeInitData #125832
    bestaru
    Participant

    Many thanx! Now it works correctly!

    in reply to: Possible error after beforeInitData #125830
    bestaru
    Participant

    Upper screenshot taken when after page loading I try to delete 3rd row “Deletable”.

    Lower screenshot taken when after page loading I try to delete 1st or 2nd row “UnDeletable” and then 3rd.

    in reply to: Possible error after beforeInitData #125829
    bestaru
    Participant


    in reply to: Possible error after beforeInitData #125828
    bestaru
    Participant

    <!DOCTYPE html>
    <html lang=”en-us”>
    <head>
    <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″/>
    <meta charset=”utf-8″ />
    <title>TEST</title>
    <script src=”/Scripts/jquery-2.1.4.js”></script>
    <script src=”/Scripts/jquery-ui-1.11.4.js”></script>
    <script src=”/Scripts/trirand/i18n/grid.locale-en.js”></script>
    <script src=”/Scripts/trirand/jquery.jqGrid.min.js”></script>
    <script src=”/Scripts/jquery.global.js”></script>

    <link href=”/Content/themes/hot-sneaks/jquery-ui.css” rel=”stylesheet”/>
    <link href=”/Content/themes/ui.jqgrid.css” rel=”stylesheet”/>

    </head>
    <body>
    <form >
    <table>
    <tr>
    <td ><table id=’grid’></table>

    </tr>
    </table>
    </form>
    </body>
    </html>
    <script>
    $(document).ready(function () {
    var data =  [
    { “id”: “1”, Title: “Non deletable”, “used”: “+” },
    { “id”: “2”, Title: “Non deletable”, “used”: “+” },
    { “id”: “3”, Title: “Deletable”, “used”: “-” }];
    $(‘#grid’).jqGrid({
    data: data,
    datatype: “local”,
    page: 1,
    colNames: [“id”,  “Title”, “used”],
    colModel: [
    {
    “searchoptions”: {
    “searchhidden”: true
    },
    “index”: “id”,
    “hidden”: true,
    “key”: true,
    “name”: “id”
    },
    {
    “editoptions”: {
    “title”: “Title”
    },
    “width”: 50,
    “align”: “center”,
    “name”: “Title”,
    “index”: “Title”,
    “editable”: true
    },
    {
    “search”: false,
    “width”: 50,
    “index”: “used”,
    “align”: “center”,
    “name”: “used”
    }],
    viewrecords: true,
    scrollrows: false,
    prmNames: { id: “id” },
    headertitles: true,
    hoverrows: false,
    pager: “#grid_pager”,
    rowNum: 10,
    rowList: [10],
    editDialogOptions: {
    “recreateForm”: true,
    “closeAfterEdit”: true,
    “modal”: true,
    },
    addDialogOptions: {
    “closeAfterAdd”: true,
    “recreateForm”: true,
    “modal”: true,
    },
    delDialogOptions: {
    “modal”: true,
    “recreateForm”: true,
    },
    searchDialogOptions: {
    “resize”: false,
    “recreateForm”: true
    },
    viewRowDialogOptions: {},
    jsonReader: {  id: “id” },
    sortname: ‘id’,
    sortorder: ‘asc’,
    caption: ‘ ‘,
    width: ‘400’,
    height: ‘100%’,
    viewsortcols: [false, ‘vertical’, true]
    });
    var grid = $(‘#grid’);
    var edopt = grid.getGridParam(‘editDialogOptions’);
    var addopt = grid.getGridParam(‘addDialogOptions’);
    var delopt = grid.getGridParam(‘delDialogOptions’);
    var viewopt = grid.getGridParam(‘viewRowDialogOptions’);
    var searchopt = grid.getGridParam(‘searchDialogOptions’);
    delopt.beforeInitData = BeforeDel;

    jQuery(‘#grid’).navGrid(‘#grid_pager’, {
    “edit”: false,
    “add”: false,
    “del”: true,
    “search”: false,
    “refresh”: false,
    “view”: false,
    “position”: “left”,
    “cloneToTop”: true
    },
    edopt, addopt, delopt, searchopt, viewopt);
    });

    function BeforeDel(form) {
    var rowid = $(‘#grid’).jqGrid(‘getGridParam’, ‘selrow’);
    var rowData = $(‘#grid’).getRowData(rowid);
    if (rowData.used == ‘+’) { alert(‘Error’); return false; }
    else { return true; }
    }
    </script>

    in reply to: Possible error after beforeInitData #125826
    bestaru
    Participant

    It’s , it seems unlikely, icons are absent only when first call of  beforeInitData  returns false. In anoter case buttons are correct.

    I’ll try to reduce code to minimum and write it.

    • This reply was modified 9 years, 2 months ago by bestaru.
    in reply to: Possible error after beforeInitData #125824
    bestaru
    Participant

    Thank you, but some problem remains. Delete Dialog shown now, but buttons Cancel & OK are without icons and not work.

    in reply to: Possible error after beforeInitData #125821
    bestaru
    Participant

    Excuse, link was truncated.
    This is truncated part:

    ?page_id=393/bugs/returning-false-from-beforeinitdata-callback-causes-a-bug

    in reply to: Possible error after beforeInitData #125820
    bestaru
    Participant

    I found description of the same problem in 2012

    Forum

    It was unanswered and unresolved

Viewing 8 replies - 1 through 8 (of 8 total)

Stay connected with us in your favorite flavor!