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
Editable and "no url set message" (although url has been set!)
04/08/2011
15:53
Avatar
Julien
Member
Members
Forum Posts: 5
Member Since:
04/08/2011
sp_UserOfflineSmall Offline

Hello,

I am using jqGrid in version 4.1.2, all my tests in Firefox 5 for now.

I want to do a simple thing: make a cell editable, and when I leave that cell / use the enter key, that cell should be validated and its new value should be sent per ajax.

But it does'nt work and I'm pretty helpless, having searched for 3hours now. Maybe you can help; First, here is my code:

    var gridUrl = '/knowledge/linksgrid/id/' + '<?php echo $this->common->getId(); ?>';
    
    jQuery("#linklist").jqGrid({
        url: gridUrl,
        mtype: "POST",
        editurl: "/knowledge/linkoperations/source/<?php echo $this->common->getId(); ?>",
        datatype: "json",
        height: "100%",
        sortname: 'objectlabel',
        rowNum: 30,
        colNames:['Id', 'Class raw name', 'Class', 'Name', 'Relation'],
        colModel:[
                {name:'id', index:'id', hidden:true},
                {name:'classname', index:'classname', hidden:true},
                {name:'classlabel', index:'classlabel', hidden:true },
                {name:'objectlabel', index:'objectlabel', sortable:true, align:"left", formatter: objectlink },
                {name:'relation', index:'relation', sortable:true, align:"left", editable: true, edittype:'text'},
        ],
        pager: "#linklist-pager", // Footer id, for paging + delete button
        caption: "",
        autowidth: true,
        multiselect: true,
        cellEdit: true,
        grouping:true,
        groupingView : {
            groupField : ['classname'],
            groupText : ['<span class="title"><span>{0}</span> ({1})</span><span class="addlink"><a href="/knowledge/managelink/name/{0}/mode/new/source/<?php echo $this->id ?>" rel="linkmgmtform" onclick="addLink($(this)); return false;">Add link</a></span>'],
            groupCollapse : false,
            groupOrder: ['asc'],
            groupColumnShow : [false]
        }
    });

Yeah so basically, this is a grid using grouping, and I want to edit the column called "relation".

You can see that both url and editurl are set. However, when I edit the cell in the grid and tap enter, I get the error message:

No url is set

As you might guess, this is akward. I really need a solution but I'm totally clueless.

ANy help is welcomed. Thanks!

05/08/2011
15:28
Avatar
Rukbat
USA
Member
Members
Forum Posts: 8
Member Since:
28/07/2011
sp_UserOfflineSmall Offline

Try:

alert("/knowledge/linkoperations/source/<?php echo $this->common->getId(); ?>");

 jQuery("#linklist").jqGrid({

or whatever debugging method you prefer, to see what URL the code actually sees.  (Unless you've set $this to something, it's null.  PHP doesn't know about Javascript's objects.)

05/08/2011
15:30
Avatar
Julien
Member
Members
Forum Posts: 5
Member Since:
04/08/2011
sp_UserOfflineSmall Offline

It's ok, the php bit appears in a view and is set with a value. So in the end the url is made of normal strings.

PHP echoes before the javascript is sent and interpreted by the browser so no problem here.

In fact I've tried with strings directly to be sure it wasn't my php bit. It is not. My question remains but thanks for the help.

08/08/2011
16:47
Avatar
Julien
Member
Members
Forum Posts: 5
Member Since:
04/08/2011
sp_UserOfflineSmall Offline

I am still hoping for an answer.

Don't be mislead by my previous post starting with "it's ok".

Actually it's not.

Anybody can help ?

10/08/2011
13:13
Avatar
Julien
Member
Members
Forum Posts: 5
Member Since:
04/08/2011
sp_UserOfflineSmall Offline

OK after today's testing by a colleague, same story, also under Chrome and IE 9.

Still no idea what is wrong with this code.

14/08/2011
10:49
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

It would be better if you have looked 3 hours into the docs instead of serching something:

I suggest you to look here:

/jqgridwiki/doku.php?id=wiki:cell_editing

Maybe the grid options : "cellurl" is your solution

Regards

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.

16/08/2011
10:17
Avatar
Julien
Member
Members
Forum Posts: 5
Member Since:
04/08/2011
sp_UserOfflineSmall Offline

I don't have 3 hours to spend in the wiki. This is not a documentation, this is random bits of unstructured info. I couldn't find it and believe me I searched the wiki, my, I really did.

I used the site, the search, the demo page, read every case. But couldn't find it.

Anyway at long last, thanks.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 496

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