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
how to pass the row's id to Ajaxify
25/10/2008
07:38
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

Hello Tony

I used to use this code with my old ajax code

jQuery("#dsEdit").click( function() {
  var dsID = jQuery("#dsTable").getGridParam('selrow');
  open_url('?option=modify&oper=edit&id='+dsID,'editDiv');
});

and it was working fine... till i needed to use an editor "TinyMCE" but the problem was when i call the editor page via ajax, the editor code won't work thats why i had to change the ajax code i used with the "Ajaxify" because it supports the events.
anyway, the Ajaxify code is

$('#dsEdit').ajaxify({
    target: '#editDiv',
    link: '?option=modify&oper=edit&id='+dsID,
    onSuccess:
        function(){
            startTiny()
        }
});

I wonder how can i pass the dsID from jqGrid to Ajaxify..

Thanks a lot Tony
Best regards

27/10/2008
23:51
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

hi again..

just wanted to up this post

any idea is appreciated

thanks

28/10/2008
09:29
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

I do not test but it could be:

$('#dsEdit').ajaxify({
    target: '#editDiv',
    link: '?option=modify&oper=edit&id='+ getDsId,
    onSuccess:
        function(){
            startTiny()
        }
});

function getDsId() {
  return jQuery(”#dsTable”).getGridParam('selrow');

28/10/2008
09:34
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

Sorry It  must be

link: '?option=modify&oper=edit&id='+ getDsId(),

28/10/2008
12:08
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

thanks a lot YamilBracho

I'll try it right now

28/10/2008
12:16
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

when i past the code you gave me..

the grid doesn't want to appeare anymore..

i really do appreciate your help..

but the problem is still there..

anyone could help me out?

thanks again

28/10/2008
13:27
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

Do you check if the parameter are been passed ?

28/10/2008
13:54
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

everything is working fine

but once i add this lines

function getDsId() {
  return jQuery(”#dsTable”).getGridParam('selrow');

the jqGrid is not working, and when i remove the getDsId function the jqGrid is working fine.. i don't know why..!!

29/10/2008
03:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

What are all the parameters of ajaxify?

Can you add a function to the link parameter?

What you mean with grid does not work?

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.

29/10/2008
09:54
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

hi Tony

"What are all the parameters of ajaxify?"

Option Value Default Note
event blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error click
link string false link to the page that are going to be loaded (instead of href)
target jQuery selector body you can use any method of jquery selection: #id, .class, element …
method string ( GET, POST, PUT, DELETE) GET (PUT, DELETE are not supported by all browsers)
tagToload jQuery selector false See examples about this option.
loading_image string /ajaxify/loading.gif Path to the loading image
loadHash boolean false See examples about this option.
params string ajax=true you may need to check if the visitor loaded this page via ajax or not.
timeout number false in ms. there is a bug in this option on linux servers
contentType string application/x-www-form-urlencoded it depends on loaded data. don’t change it if you dont know what it is.
dataType string html
cache boolean false control the browser to cache data or not.
username string false A usename to be used in response to an HTTP access authentication request.
password string false A password to be used in response to an HTTP access authentication request.
onStart function false A pre-callback to modify the XMLHttpRequest object before it is sent
onError function false A function to be called if the request fails.
onSuccess function false A function to be called if the request succeeds
onComplete function false A function to be called when the request finishes (after success and error callbacks are executed)

more info: http://max.jsrhost.com/ajaxify.....ry-plugin/

"Can you add a function to the link parameter?"

I'm not that expert with ajaxify or js.

"What you mean with grid does not work?"

the grid is working fine till i add this function in between <head></head>

function getDsId() {
  return jQuery(”#dsTable”).getGridParam('selrow');
}

because once i did.. the jqGrid doesn't work.. i mean it doesn't show any thing not even the table

regards

29/10/2008
10:02
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You should add this function within

jQuery(document).ready(function(){...

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.

29/10/2008
11:05
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

do you mean like this?

jQuery(document).ready(function(){
    function getDsId() {
        return jQuery(”#dsTable”).getGridParam('selrow');
    }
});

because even so. it doesn't work

if you don't mind please give me an example

best regards

29/10/2008
22:30
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

hi again guys, the reason of making jqGrid doesn't work at all when i add that function was the "" because when i copy it i just paste it into the file without noticing it changed..

anyway. now the problem is everything works fine exept ajaxify, because it seems that its being called once the page is loaded not once i click the link.

i mean. because of

link: '?option=modify&oper=edit&id='+ getDsId(),

so ajaxify calls getDsId() once the page is loaded so i made this code.. and it works, the only problem is the ajaxify doesn't work from the first click so i have to click twice

one click to select the row
and two click on edit link

and here is the code..

jQuery(document).ready(function(){
    .....
    jQuery("#dsEdit").click( function() {
        var dsID = jQuery("#dsTable").getGridParam('selrow');
        if( dsID == null ) return null;
        $('#dsEdit').ajaxify({
           target: '#dsAjaxImages',
           link: '?dsOption=modify&dsOper=edit&id='+dsID,
            onSuccess:
                function(){
                    startTiny()
                }
         });
    });
    .....
});

could anyone help with this...?

thanks again..

best regards

30/10/2008
08:42
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

It seems that row selecting event occurs first than Click on the link and it makes sense because you have to select the row first to populate the selrow property.

Maybe doing some hacking in the selectRow event could do what you want to do...

HTH

30/10/2008
12:05
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

but i think selectRow is working fine and so ajaxify..

my only problem i don't know how to combine them together

if anyone expert with javascript, please help me out

thanks a lot guys

30/10/2008
19:46
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

please check this out http://max.jsrhost.com/2008/10.....comment-36

it could be helpful to you.. so you can get a clear vision on the problem..

please.. guys.. i don't know what to do...

thanks a lot

31/10/2008
03:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Please make alert here

....

jQuery(”#dsEdit”).click( function() {
        var dsID = jQuery(”#dsTable”).getGridParam('selrow');

       alert(dsID);

....

What you expect here?

Also check if the id support the right characters - google for id allowed characters.

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.

31/10/2008
03:50
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

i really tried the aleart for the id to see if it works or not.. actually it is working..

but guys i'm not expert with js or jq or jqG or ajaxify..

i tried many many times to make work..  but its just useless..

guys.. all i needed is just once i click on the link.. it gets the id then open it via ajaxify..

i guess i could make it but not properly..

the first click on the link.. the ajaxify doesn't work but jqgrid gets the id

and the second click.. the ajaxify works depending on the previous click which the jqgrid got the id on the first click

i will really appreciate your help...

i really do need that to work

please guys, please.. help me out

best regards

01/11/2008
03:59
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

To identify the problem, please send a link to the page or send me

the problematic page with the data returned from server.

You can email me to : tony at trirand dot com

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:
67 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