mdp

Forum Replies Created

Viewing 7 replies - 16 through 22 (of 22 total)
  • Author
    Replies
  • in reply to: Strange behaviour after updating to jqGrid 4.7.0 #103787
    mdp
    Participant

    I’ll use the formatter: “select” and change the stored procedures to return the ids. I also will use the workaround till the bug is fixed.

    By the way, by inspecting your code I found I’m setting some properties that aren’t needed as sorttype:text and index.

    Thanks for your help Oleg!

    in reply to: Strange behaviour after updating to jqGrid 4.7.0 #103783
    mdp
    Participant

    Here’s the jsfiddle for the issue with prmNames (I removed the hidden:true property for column idPer. In edit form the value is displayed correctly, after saving is replaced by the number of the row):

    http://jsfiddle.net/d26hzhu6/2/

    Notice that if you remove the property id: “idPer” in prmNames this problem is fixed.

    Also the same code works correctly in v4.4.4, as you can see in the fiddler used below.

    Regarding the issue with the combos:

    I was using version 4.4.4. I know it may sound strange, but it was working as I previously explained without formatter:’select’:

    I retrieve from the DB the text “Australia” for the field “idCity”. When opening the edit form, jqgrid will match the text to positionate the combo. After successfull submit (which post idCity=3) the text “Australia” would appear in the grid instead of the value 3.

    Here’s the jsfiddle using v.4.4.4 exposing the behaviour I mentioned above:

    http://jsfiddle.net/Lgy7ae3h/1/

    After comparing the code in formedit I found that in version 4.4.5 some code was removed that provided that functionality (all related to a var name “expost”). I also found the commit of that change:

    https://github.com/tonytomov/jqGrid/commit/edb5073b6bd617878221674d201cba060489241c

    Now, how can I update my code to make it work as before but using the new version?. I have more than 20 grids and I would try to avoid to change the stored procedures.

    in reply to: Strange behaviour after updating to jqGrid 4.7.0 #103672
    mdp
    Participant

    Here’s the jsfiddle:

    http://jsfiddle.net/d26hzhu6/

    The only thing that is missing is the Ajax response. I found the following example, but I don’t know how to use it to replace the Ajax call in jqgrid:

    new Request.JSONP({
    Â Â Â url: ‘http://jsfiddle.net/echo/jsonp/’,
    Â Â Â data: {
    Â Â Â Â Â Â Â text: ‘some text’,
    Â Â Â Â Â Â Â par1: ‘another text’
    Â Â Â },
    Â Â Â onSuccess: function(response) {
    Â Â Â Â Â Â Â show_response(response, $(‘post’));
    Â Â Â }
    }).send();

    in reply to: Strange behaviour after updating to jqGrid 4.7.0 #103671
    mdp
    Participant

    Thanks for your response. I’ve never used jsfiddle and I don’t know how to simulate ajax requests (apparently only POST is supported and I’m using GET). Anyway here’s a small demo:

    HTML Body:

    Â Â Â <div>
    Â Â Â Â Â Â <table id=”sampleGrid”><tr><td></td></tr></table>
    Â Â Â Â Â Â <div id=”pagerSampleGrid”></div>Â Â Â
    Â Â Â </div>

    Javascript:

    Â Â Â //<![CDATA[
    Â Â Â Â Â Â Â $(document).ready(function () {Â Â Â Â Â Â Â Â Â Â Â
    Â Â Â Â Â Â Â Â Â Â Â setjqGridSettings();
    Â Â Â Â Â Â Â Â Â Â Â setGridRequirentes();Â Â Â Â Â Â Â Â Â Â Â
    Â Â Â Â Â Â Â });

    Â Â Â
    function setjqGridSettings()
    {Â Â Â
    Â Â Â $.extend($.jgrid.defaults,
    Â Â Â {
          mtype:”POST”,                   Â
    Â Â Â Â Â Â datatype: ‘json’,
          ajaxGridOptions: { contentType: “application/json; charset=utf-8” },  Â
    Â Â Â Â Â Â viewrecords: true,
    Â Â Â Â Â Â loadonce: true,
    Â Â Â Â Â Â gridview: true,
    Â Â Â Â Â Â scrollOffset: 0,
    Â Â Â Â Â Â autowidth: true,
    Â Â Â Â Â Â ignoreCase: true,
    Â Â Â Â Â Â jsonReader : {
    Â Â Â Â Â Â Â Â Â Â root: “d.rows”,
    Â Â Â Â Â Â Â Â Â Â page: “d.page”,
    Â Â Â Â Â Â Â Â Â Â total: “d.total”,
    Â Â Â Â Â Â Â Â Â Â records: “d.records”,
    Â Â Â Â Â Â Â Â Â Â cell: “”},
    Â Â Â Â Â Â ajaxSelectOptions: { type: “GET”, contentType: ‘application/json; charset=utf-8’ }
    Â Â Â });

    Â Â Â $.extend($.jgrid.edit,
    Â Â Â {
    Â Â Â Â Â Â ajaxEditOptions: { contentType: “application/json; charset=utf-8″ },
    Â Â Â Â Â Â closeAfterEdit: true,
    Â Â Â Â Â Â closeAfterAdd: true,
    Â Â Â Â Â Â closeOnEscape: false,
    Â Â Â Â Â Â reloadAfterSubmit: false,
    Â Â Â Â Â Â jqModal: false
    Â Â Â });Â Â Â
    }Â Â Â
    Â Â Â
    function setGridRequirentes()
    {Â Â Â
    Â Â Â var modSettings =
    Â Â Â {
    Â Â Â Â Â Â width: 440,
    Â Â Â Â Â Â url: ‘myUrl.aspx’,
    Â Â Â Â Â Â serializeEditData: function(postData) {Â Â Â Â Â Â Â Â Â
    Â Â Â Â Â Â Â Â Â console.log(postData)
    Â Â Â Â Â Â }Â Â Â Â Â Â
    Â Â Â };

    Â Â Â var sampleData = [
    Â Â Â Â Â Â Â Â Â Â Â {idPer:”13570″, person:”some name 1″,idCity:”Washington”},
    Â Â Â Â Â Â Â Â Â Â Â {idPer:”34233″, person:”some name 2″,idCity:”Australia”},
    Â Â Â Â Â Â Â ];Â Â Â Â Â Â Â Â Â Â
    Â Â Â Â Â Â Â Â Â
    Â Â Â $(“#sampleGrid”).jqGrid({Â Â Â Â Â Â Â
    Â Â Â Â Â Â Â //datatype:’local’,
    Â Â Â Â Â Â Â //data: sampleData,
          url: “MyPage.aspx/getPeople”,  Â
          mtype: “GET”,      Â
    Â Â Â Â Â Â prmNames: {id: “idPer”, search:null, nd : null, page: null, rows: null, sort : null, order : null}, Â
    Â Â Â Â Â Â colNames:[‘idPer’, ‘person’, ‘idCity’], Â
    Â Â Â Â Â Â colModel:[
    Â Â Â Â Â Â Â Â Â {name:’idPer’,index:’idPer’, hidden: true, key: true, width:55, editable:true, editrules:{edithidden:false}, sorttype:’int’},
    Â Â Â Â Â Â Â Â Â {name:’person’,index:’person’, editable:true, editoptions:{size:39}, width:190, sorttype:’text’},
    Â Â Â Â Â Â Â Â Â {name:’idCity’,index:’idCity’, editable:true, edittype:’select’,
    Â Â Â Â Â Â Â Â Â Â Â Â editoptions:{ value:”1:London;2:Washington;3:Australia”},width:90, sorttype:’text’}],
    Â Â Â Â Â Â rowNum:5,
    Â Â Â Â Â Â rowList:[5,10,15,20],
          pager: ‘#pagerSampleGrid’,  Â
          caption:”Sample Grid”     Â
    Â Â Â });Â Â Â
    Â
    Â Â Â $(“#sampleGrid”).jqGrid(‘navGrid’,’#pagerSampleGrid’,{edit:true,add:true,del:false,search:false,refresh:false},modSettings);
    }
    Â Â Â //]]>

    Â

    The response from my web service getPeople is (I’m using the format suggested in jqGrid demos “Data Mapping”->”Data Optimization” to reduce the size of the response):

    2","Washington"]]}}

    In serializeEditData I only get the number of the row instead of the "idPer" value as can be seen in the console.
    Also note that after saving (gives an error since the webservice is not found) for example Australia is replaced by 3.

    Thanks for your help

    in reply to: Strange behaviour after updating to jqGrid 4.7.0 #103669
    mdp
    Participant

    With v4.6 problem #2 doesn’t occur.

    By the way, I also had to change the date format in grid.locale-es, since it’s displaying dates as d-m-Y instead of d/m/Y

    in reply to: modal dialog problem in IE7 #100855
    mdp
    Participant

    Thanks for your reply.

    I've already read that information but I don't know if jQuery 2.0 Final has a released date (I only found early 2013, not long after 1.9).

    Besides, jQuery 1.9 and 2.0 will support the same API. As stated in jQuery blog: “Our goal is for 1.9 and 2.0 to be interchangeable as far as the API set they support. When 2.0 comes out, your decision on which version to choose should be as simple as this: If you need IE 6/7/8 support, choose 1.9; otherwise you can use either 1.9 or 2.0.”

    I know IE 8 and below are not standards-compliants and full of bugs, but I think maybe is too early to drop support.

    in reply to: modal dialog problem in IE7 #100842
    mdp
    Participant

    Any solution to this problem?

    Thanks!

Viewing 7 replies - 16 through 22 (of 22 total)

Stay connected with us in your favorite flavor!