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
Jgrid and modal box
21/09/2009
04:32
Avatar
Samarcus
Guest
Guests

Hello

I am newbie to JqGrid and... french. I've spent a lot of time reading topics but no answers for my problem;
I think it's quite simple but I  really don't see how to solve it
In Php code each row has a link like :

    $civnmpr = $row[CIVILITE]." <strong>" .htmlentities($row[NOM])."</strong> ".htmlentities($row[PRENOM]);
    $civnmpr = "<a href='miniature.php?id=".$row[IDUSER]."' rel=\\"#overlay\\">".$civnmpr."</a>";
    echo "<cell><![CDATA[".$civnmpr."]]></cell>";

and here my jqgrid param :

    <script type="text/javascript">
        jQuery(document).ready(function(){
            jQuery("#annuaire").jqGrid({
                url:'example.php',
                datatype: 'xml',
                mtype: 'GET',
                height: 400,
                colNames:['Nom - Prenom', 'Tel.','Etg-Pièce','Fonctions','Affectation'],
                colModel :[
                    {name:'nom', index:'NOM', width:185},
                    {name:'tel', index:'TEL', width:35, align:'right'},
                    {name:'piece', index:'PIECE', width:80, align:'right'},
                    {name:'fonction', index:'FONCTION', width:180, align:'right'},
                    {name:'bureau', index:'BUREAU', width:160, sortable:false} ],
                pager: jQuery('#pager'),
                rowNum:20,
                rowList:[10,20,30],
                sortname: 'NOM',
                sortorder: "asc",
                viewrecords: true,
               imgpath: 'themes/basic/images',
                caption: 'Annuaire da Cab',
                gridComplete: function(){
                    $("a[rel]").overlay(function() {
                    var wrap = this.getContent().find("div.wrap");
                wrap.load(this.getTrigger().attr("href"));
                    });
                } /* End fonction*/
            });
    });
       
    </script>

a piece of Html

      <div style="overflow:hidden; margin:10px 5px;">
      <table id="annuaire" class="scroll"></table>
      <div id="pager" class="scroll" style="text-align:center;"></div>
      </div>

<!-- Div pour les miniatures -->
<div class="overlay" id="overlay">
    <!-- the external content is loaded inside this tag -->
    <div class="wrap"></div>
</div>

function in Gridcomplete display a modal box (a Jquery tool from flowplayer.org/tools/demos/overlay/external.html)
All of this works fine when loading (the modal box appears correctly) the first time but no on paging or sorting. It display the right link but not in a modal box as it's suppose to do.

Could u please show me, just once.
I'll be vrey greatful for ur help
Sam

21/09/2009
09:15
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Could you please first try with

gridComplete: function(){

alert("GridComplete");
}

If this works for every request, then maybe the problem is here

$(”a[rel]“).overlay(function() {  var wrap = this.getContent().find(”div.wrap”); wrap.load(this.getTrigger().attr(”href”)); });

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.

22/09/2009
04:10
Avatar
Samarcus
Guest
Guests

Hi Tomy

First, many thanks for ur answer.

I try as u said : works all time

I also try

gridComplete: function(){
                    $(”a[rel]“).overlay(function() {

                    alert("Ok"); displayed but only on 1st page when loading
                    var wrap = this.getContent().find(”div.wrap”);
                wrap.load(this.getTrigger().attr(”href”));
                    });
                } /* End fonction*/

It seems that the function is not loaded anymore after paging or sorting, so I'll have to find a way reload it.

Can u help me twice. Iam completly lost

Thanks again

Sam

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

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

Hello,

What is the purpose of the overlay plugin. Check the value of wrap? What you want to get?

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.

22/09/2009
18:34
Avatar
samarcus
Guest
Guests

Hi,

the this variable is a pointer to the Overlay API, so "var wrap" is an object.http://flowplayer.org/tools/ov.....y.html#api.
It's simply open a modal box with external file content.

My purpose is to show when click on each link (row) inside the grid, a few detail coming from the miniature.php file.

That's all.  I wonder what's wrong .Tell me if I'd better give up and found another jquery modal box

Thanks again Tony, really

Sam

25/09/2009
04:47
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

could you please set the parameter

viewrecords: false,

and test. Please let me known if this work.

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/09/2009
11:35
Avatar
Samarcus
Guest
Guests

Hi Tony,

Thanks for the time u spend with me.

Unfortunalty, it does'nt change anything.

Because it's loaded anytime, may be a could put the overlay function in the Php request ? i'll try it

Regards

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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