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_TopicIcon
checkbox value when true not saving to false in jqGrid-3.6
24/11/2009
19:23
Avatar
fed
Guest
Guests

I noticed that when I am using cell editing with checkboxes (using edittype:'checkbox') in jqGrid-3.6 and the cell has a value of true ('Yes')  prior to editing it and then I click on the cell to make if false ('No') the change is never saved.  However if the cell has a value of false ('No') and i click on it to make it true ('Yes') then the cell value is changed correctly and the cell is made 'dirty'.  The problem seems to be in grid.common.js inside the createElm function. By changing line 303 from:

                elem.value = cbval[0];

                 to

                elem.value = (vl === cbval[0]) ? cbval[1] : cbval[0];

seems to fix the problem.  Is this a correct fix?  Am I the only one having this bug?

25/11/2009
10:03
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Not sure if this is exactley the problem - here is the definition of the value when the input type is checkbox -

"Value that is submitted if checked." - i.e. in terms of jqGrid this should be the Yes value.

Also could you please post the entry jqGrid related code -  I have impression that you have other things - like events and etc which may cause this.

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

25/11/2009
12:38
Avatar
fed
Guest
Guests

When does the value get set to its unchecked value when the user unchecks the actual checkbox?  If you look at the line I posted it will always be cbval[0] which always be the 'true' value.  Here is my my grid:

<script>
    // Load the Product Search Grid using JQGrids
    jQuery(document).ready(function(){

jQuery("#pricingGrid").jqGrid({
          url: '/vine-admin-static/jquery-pricing.json',
          datatype: 'json',
          sortname : 'productId',
          sortorder : 'desc',
          viewsortcols: true,
          rowNum:100,
          rowList:[25,50,75,100],
          pager: '#pricingGridPager',
          height : '400',
          width : '1698',
         
          cellEdit: true,
          cellsubmit: 'clientArray',
          jsonReader : {
                root : "results",
                page : "currentpage",
                total : "totalpages",
                records : "totalCount",
                repeatitems : false
            },         
          colModel:[
                {name:'productId', index:'productId', width:100, label:'Product Id', sortable: false},
                /* commented it out just so the grid would be smaller to look at the checkbox problem
                {name:'offerId', index:'offerId', width:100, label:'Offer ID', sortable: false},
                {name:'npOfferId', index:'npOfferId', width:100, label:'NPOffer ID', sortable: false},
                {name:'slotGroupId', index:'slotGroupId', width:100, label:'SG ID', sortable: false},
                {name:'versionDate', index:'versionDate', width:100, label:'Version Date', sortable: false},
                {name:'publisherName', index:'publisherName', width:100, label:'Publisher', sortable: false},
                {name:'publisherId', index:'publisherId', width:100, label:'Publisher ID', sortable: false},
                {name:'productName', index:'productName', width:100, label:'Product Name', sortable: false},               
                {name:'storeCode', index:'storeCode', width:100, label:'Store', sortable: false},
                {name:'displayStoreCode', index:'displayStoreCode', width:100, label:'Display Store code', sortable: false},
                {name:'productType', index:'productType', width:100, label:'Product Type', sortable: false},
                {name:'quickTurn', index:'quickTurn', width:100, label:'QT', sortable: false},
                {name:'licenseCode', index:'licenseCode', width:100, label:'License Code', sortable: false},
                {name:'videoType', index:'videoType', width:100, label:'Video Type', sortable: false},
                {name:'displayVideoType', index:'displayVideoType', width:100, label:'', sortable: false},
                {name:'releaseDate', index:'releaseDate', width:100, label:'', sortable: false},
                {name:'releaseDateDiff', index:'releaseDateDiff', width:100, label:'', sortable: false},
                {name:'homeVideoStreetStartDateDiff', index:'homeVideoStreetStartDateDiff', width:100, label:'', sortable: false},
                {name:'offerStartDate', index:'offerStartDate', width:100, label:'', sortable: false},
                {name:'wspFormula', index:'wspFormula', width:100, label:'', sortable: false},
                {name:'minWholesalePrice', index:'minWholesalePrice', width:100, label:'', sortable: false, align:'center'},
                {name:'deemedRetailPrice', index:'deemedRetailPrice', width:100, label:'', sortable: false, align:'center'},
                {name:'publisherSuggestedRetailPrice', index:'publisherSuggestedRetailPrice', width:100, label:'', sortable: false, align:'center'},
                {name:'suggestedRetailPrice', index:'suggestedRetailPrice', width:100, label:'', sortable: false, align:'center'},
                {name:'notes', index:'notes', width:100, label:'', sortable: false},
                {name:'split', index:'split', width:100, label:'', sortable: false},
                */
                {name:'firstApprover', index:'firstApprover', width:50, label:'', sortable: false, align:'center', editable:true, edittype:'checkbox', editoptions: { value:"Yes:No" }},
                {name:'secondApprover', index:'secondApprover', width:50, label:'', sortable: false, align:'center', editable:true, edittype:'checkbox', editoptions: { value:"Yes:No" }},
                /*
                {name:'newNote', index:'newNote', width:100, label:'', sortable: false},
                {name:'statusMsg', index:'statusMsg', width:100, label:'', sortable: false},
                {name:'statusCode', index:'statusCode', width:100, label:'', sortable: false},
                {name:'pricingUserRuleId', index:'pricingUserRuleId', width:100, label:'', sortable: false} 
                */             
            ]         
        });

    });
</script>

<div id="ppricingGridPager"></div>
<table id="pricingGrid"></table>

Here is a sample of the json that comes back when loading the grid:

{
    "currentpage" : 1,
    "totalpages" : 9,
    "totalCount" : 849,
    "results" : [{
                "slotGroupId" : 41567,
                "versionDate" : "1256688884011",
                "productId" : 40012,
                "npOfferId" : "2BC0024BE",
                "publisherName" : "MTV",
                "publisherId" : 1227,
                "offerId" : 98907,
                "productName" : "Dora's Special Adventures | Season 3, Ep. 3",
                "productType" : "EPISODE",
                "wspFormula" : "Split_N_MinWSP",
                "licenseCode" : "EST",
                "videoType" : "SD",
                "displayVideoType" : "SD-PSN",
                "releaseDate" : "",
                "homeVideoStreetStartDate" : "",
                "offerStartDate" : "12/14/2009",
                "offerEndDate" : "12/31/2999",
                "split" : "70",
                "minWholesalePrice" : "1.4",
                "wholesalePrice" : "",
                "deemedRetailPrice" : "",
                "publisherSuggestedRetailPrice" : "",
                "suggestedRetailPrice" : "1.99",
                "firstApprover" : "Yes",
                "secondApprover" : "No",
                "quickTurn" : "false",
                "storeCode" : "US-EN",
                "displayStoreCode" : "US",
                "pricingUserRuleId" : "",
                "notes" : []
            }, {
                "slotGroupId" : 41566,
                "versionDate" : "1256688884202",
                "productId" : 40011,
                "npOfferId" : "2BC0024BG",
                "publisherName" : "MTV",
                "publisherId" : 1227,
                "offerId" : 98909,
                "productName" : "Dora's Special Adventures | Season 3, Ep. 2",
                "productType" : "EPISODE",
                "wspFormula" : "Split_N_MinWSP",
                "licenseCode" : "EST",
                "videoType" : "SD",
                "displayVideoType" : "SD-PSN",
                "releaseDate" : "",
                "homeVideoStreetStartDate" : "",
                "offerStartDate" : "12/14/2009",
                "offerEndDate" : "12/31/2999",
                "split" : "70",
                "minWholesalePrice" : "1.4",
                "wholesalePrice" : "",
                "deemedRetailPrice" : "",
                "publisherSuggestedRetailPrice" : "",
                "suggestedRetailPrice" : "1.99",
                "firstApprover" : "No",
                "secondApprover" : "Yes",
                "quickTurn" : "false",
                "storeCode" : "US-EN",
                "displayStoreCode" : "US",
                "pricingUserRuleId" : "",
                "notes" : []
            }, {
                "slotGroupId" : 41565,
                "versionDate" : "1256688884230",
                "productId" : 40010,
                "npOfferId" : "2BC0024BC",
                "publisherName" : "MTV",
                "publisherId" : 1227,
                "offerId" : 98905,
                "productName" : "Dora's Special Adventures | Season 3, Ep. 1",
                "productType" : "EPISODE",
                "wspFormula" : "Split_N_MinWSP",
                "licenseCode" : "EST",
                "videoType" : "SD",
                "displayVideoType" : "SD-PSN",
                "releaseDate" : "",
                "homeVideoStreetStartDate" : "",
                "offerStartDate" : "12/14/2009",
                "offerEndDate" : "12/31/2999",
                "split" : "70",
                "minWholesalePrice" : "1.4",
                "wholesalePrice" : "",
                "deemedRetailPrice" : "",
                "publisherSuggestedRetailPrice" : "",
                "suggestedRetailPrice" : "1.99",
                "firstApprover" : "No",
                "secondApprover" : "No",
                "quickTurn" : "false",
                "storeCode" : "US-EN",
                "displayStoreCode" : "US",
                "pricingUserRuleId" : "",
                "notes" : []
            }]
}

26/11/2009
22:46
Avatar
aristideau
Member
Members
Forum Posts: 11
Member Since:
26/05/2009
sp_UserOfflineSmall Offline

I have come here to log this very same bug.

Here is a simple self explanatory demo that highlights the bug

Sorry boss does not want me linking to the site

regards

AA

27/11/2009
02:57
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Thanks. Take me a long time to reproduce your bug. In your description you missed that the bug is present when we use a mouse click. Also if you use the following scenario – evarthing work ok.

1. Click on cell with content Yes

2. Change the value from checked to unchecked

3. Press Enter to save it

evarthing correct.

But this not work (bug)

1. Click on cell with content Yes

2. Change the value from checked to unchecked

3. “CLICK ANOTHER CELL”

Also the problem is not in grid.common.js, but in grid.celledit.js

Have corrected them

Thanks

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

01/12/2009
20:18
Avatar
fed
Guest
Guests

Thanks!!!  When will your next stable release go out?

Fed

02/12/2009
09:02
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

You can grab the fix from GitHub and if you have installed ant you can build the min version

Also I plan to publish a bug fix at end of this week.

There will be no post for this, so you will check the download page.

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
96 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