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
Problem with JQGrid in Modal Dialog after reload page
12/07/2011
15:22
Avatar
cawa
New Member
Members
Forum Posts: 1
Member Since:
12/07/2011
sp_UserOfflineSmall Offline

I had a problem opening a Modal Dialog after page reload. I solved using "class identifier" instead of "id".

but now I'm stuck on another problem.

In the Modal Dialog I have a JQGrid:

In example.jsp I press the button "RELOAD". Then, in "mainContent", appears the button "FIND", that open a modal dialog with a JQGrid perfectly working.

But if I press again "RELOAD" button and then "FIND" the MODAL DIALOG appears, but the JQGRID in it doesn't show any result!

'cause it seemed to be a "creating elements with same id" problem, I try to call the JQGrid with class identifier, but nothing.

Here an example: http://web.ire-omba.it:8080/pr.....sempio.jsp

example.jsp:

<script type="text/javascript">
  $(document).ready(function() {
    $('#Button1').button().click(function() {
    $("#mainContent").html('').load("example_1.jsp");
    });
  });
</script>
<input id="Button1" type="button" value="RELOAD" />
<div id="mainContent"></div>

example_1.jsp:

<script type="text/javascript">
  $(document).ready(function() {
    $(".b").button().click(function() {
      $(".d").jqGrid('setGridParam',{datatype:"json"}).trigger("reloadGrid");
      $(".c").dialog("open");
    });

    $("#a_grid").jqGrid({
      url:'search_customer.jsp',
      datatype: 'local',
      mtype: 'GET',
      colNames:['Sede','Codice','Ragione Sociale'],
      colModel :[
        {name:'sede', index:'sede', width:20, search:true, stype:'select', edittype:'select', editoptions:{value:{'IT':'IT','CN':'CN'}}, searchoptions:{value:":All;IT:IT;CN:CN"}, editable:true, editrules:{required:true}},
        {name:'codice_cliente', index:'codice_cliente', width:100, fixed:true, search:true, stype:'text', editable:true, editoptions:{size:6, maxlength:6}, editrules:{required:true}},
        {name:'cliente', index:'cliente', search:true, stype:'text', editable:true, editoptions:{size:30, maxlength:50},  editrules:{required:true}}
      ],
      pager: jQuery('#a_pager'),
      rowNum:15,
      sortname: 'cliente',
      sortorder: 'asc',
      gridwiew: true,
      viewrecords: true,
      loadonce:false,
      …
      …
    });

    jQuery("#a_grid").jqGrid('navGrid','#a_pager', {edit:false, add:true, del:false, search:false, refresh:true},
      {}, // edit options
      {}, // add options
      {}, //del options
      {multipleSearch:true} //search options
    );

    jQuery("#a_grid").jqGrid('filterToolbar',{stringResult:true, searchOnEnter:false});

    $("#a_form").dialog({
      autoOpen: false,
      height: 480,
      width: 625,
      modal: true,
      close: function() {
        $("#a_grid").dialog("close");
      }
    });
  });
</script>

<input type="button" value="FIND" class="b" />

<div id="a_form" title="Cerca Cliente" class="c">
  <table id="a_grid" align="center" class="d"></table>
  <div id="a_pager" align="center"></div>
</div>

Thank you.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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