Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Help with jqGrid values disappear when click on Add button
01/10/2012
19:35
Avatar
gena_mak
Member
Members
Forum Posts: 5
Member Since:
27/09/2012
sp_UserOfflineSmall Offline

Hello,
I asked the question before but, I realized it was not clear enough (English is not my first language). So, I will try again with working example that I took from some site.

The link to working grid is here to the Example page: https://www.easyflex.com/accnttrx_conf3.cfm;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..le&gt;
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8″ />

    <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/redmond/jquery-ui.css;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..ery-ui.css" />
    <link rel="stylesheet" type="text/css" href="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.2.0/plugin/ui.multiselect.css;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..select.css" />
    <link rel="stylesheet" type="text/css" href="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.2.0/css/ui.jqgrid3.css;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..qgrid3.css" />
    <style type="text/css">
    </style>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js%22%3E%3C/script;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..ery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js%22%3E%3C/script;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..-ui.min.js"></script>
    <script type="text/javascript" src="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.2.0/js/i18n/grid.locale-en.js%22%3E%3C/script;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..cale-en.js"></script>
    <script type="text/javascript">
        $.jgrid.no_legacy_api = true;
        $.jgrid.useJSON = true;
    </script>
    <script type="text/javascript" src="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.2.0/plugin/ui.multiselect.js%22%3E%3C/script;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..iselect.js"></script>
    <script type="text/javascript" src="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.2.0/js/jquery.jqGrid.src.js%22%3E%3C/script;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..rid.src.js"></script>

    <script type="text/javascript">
    //<![CDATA[
        /*global $ */
        /*jslint browser: true, plusplus: true */
        $.jgrid.formatter.integer.thousandsSeparator = ',';
        $.jgrid.formatter.number.thousandsSeparator = ',';
        $.jgrid.formatter.currency.thousandsSeparator = ',';
        $(function () {
            'use strict';
            var mydata = [
                    {id: "1",  invdate: "2007-10-01", name: "test",   note: "note",   amount: "200.00", tax: "10.00", closed: true,  ship_via: "TN", total: "210.00"},
                    {id: "2",  invdate: "2007-10-02", name: "test2",  note: "note2",  amount: "300.00", tax: "20.00", closed: false, ship_via: "FE", total: "320.00"},
                    {id: "3",  invdate: "2007-09-01", name: "test3",  note: "note3",  amount: "400.00", tax: "30.00", closed: false, ship_via: "FE", total: "430.00"},
                    {id: "4",  invdate: "2007-10-04", name: "test4",  note: "note4",  amount: "200.00", tax: "10.00", closed: true,  ship_via: "TN", total: "210.00"},
                    {id: "5",  invdate: "2007-10-31", name: "test5",  note: "note5",  amount: "300.00", tax: "20.00", closed: false, ship_via: "FE", total: "320.00"},
                    {id: "6",  invdate: "2007-09-06", name: "test6",  note: "note6",  amount: "400.00", tax: "30.00", closed: false, ship_via: "FE", total: "430.00"},
                    {id: "7",  invdate: "2007-10-04", name: "test7",  note: "note7",  amount: "200.00", tax: "10.00", closed: true,  ship_via: "TN", total: "210.00"},
                    {id: "8",  invdate: "2007-10-03", name: "test8",  note: "note8",  amount: "300.00", tax: "20.00", closed: false, ship_via: "FE", total: "320.00"},
                    {id: "9",  invdate: "2007-09-01", name: "test9",  note: "note9",  amount: "400.00", tax: "30.00", closed: false, ship_via: "TN", total: "430.00"},
                    {id: "10", invdate: "2007-09-08", name: "test10", note: "note10", amount: "500.00", tax: "30.00", closed: true,  ship_via: "TN", total: "530.00"},
                    {id: "11", invdate: "2007-09-08", name: "test11", note: "note11", amount: "500.00", tax: "30.00", closed: false, ship_via: "FE", total: "530.00"},
                    {id: "12", invdate: "2007-09-10", name: "test12", note: "note12", amount: "500.00", tax: "30.00", closed: false, ship_via: "FE", total: "530.00"}
                ],
                $myGrid = $("#list"),
                selRowData = null;

            $myGrid.jqGrid({
                datatype: 'local',
                data: mydata,
                colNames: ['Inv No', 'Date', 'Client', 'Amount', 'Tax', 'Total', 'Closed', 'Shipped via', 'Notes'],
                colModel: [
                    {name: 'id', index: 'id', width: 65, align: 'center', sorttype: 'int', hidden: true},
                    {name: 'invdate', index: 'invdate', width: 80, align: 'center', sorttype: 'date',
                        formatter: 'date', formatoptions: {newformat: 'd-M-Y'}, datefmt: 'd-M-Y'},
                    {name: 'name', index: 'name', width: 70, editable: true, editoptions: {
                            defaultValue: function () {
                                return selRowData === null ? '' : '_' + selRowData.name + '_';
                            }
                        }},
                    {name: 'amount', index: 'amount', width: 75, formatter: 'number', sorttype: 'number', editable: true, align: 'right'},
                    {name: 'tax', index: 'tax', width: 55, formatter: 'number', sorttype: 'number', editable: true, align: 'right', hidden: true},
                    {name: 'total', index: 'total', width: 65, formatter: 'number', sorttype: 'number', editable: true, align: 'right'},
                    {name: 'closed', index: 'closed', width: 75, align: 'center', formatter: 'checkbox', editable: true,
                        edittype: 'checkbox', editoptions: {value: 'Yes:No', defaultValue: 'Yes'}},
                    {name: 'ship_via', index: 'ship_via', width: 100, align: 'center', formatter: 'select', editable: true,
                        edittype: 'select', editoptions: {value: 'FE:FedEx;TN:TNT;IN:Intim', defaultValue: 'Intime'}},
                    {name: 'note', index: 'note', width: 70, editable: true, sortable: false}
                ],
                rowNum: 10,
                rowList: [5, 10, 20],
                pager: '#pager',
                gridview: true,
                rownumbers: true,
                sortname: 'invdate',
                viewrecords: true,
                sortorder: 'desc',
                ondblClickRow: function (rowid, iRow, iCol, e) {
                    alert(rowid);
                },
                caption: 'Grid with moved multiselect chachboxes',
                height: 'auto'
            });

            $myGrid.jqGrid ('navGrid', '#pager',
                {add: true, del: false, refresh: true, view: false},
                {},
                {
                    beforeInitData: function () {
                        var rowid = $myGrid.jqGrid('getGridParam', 'selrow');
                        selRowData = rowid !== null ? $myGrid.jqGrid('getRowData', rowid): null;
                    }
                },
                {},
                {multipleSearch: true, overlay: false});
        });
    //]]>
    </script>
</head>
<body>
    <table id="list"><tr><td/></tr></table>
    <div id="pager"></div>
</body>
</html>

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
41 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information