Solved

jquery jeditable data in the flexigrid

Posted on 2008-06-15
10
752 Views
Last Modified: 2012-06-27
Hello Experts,
I am using the code below to post the jEditable column data via Ajax request. At present it is posting data for all the jEditable columns available in the Flexigrid rows. However I wanted to post data only for the row which are selected.  
Please can someone advice/help in this?
Your help is much appreciated.
Thanks
Sam
0
Comment
Question by:newbie27
  • 7
  • 3
10 Comments
 
LVL 8

Author Comment

by:newbie27
ID: 21789351
Hello,

I am using attached function to submit data using ajax, I now know which jEditable column has been edited by this function

   function getSelected()
        {
               $("input.chkRefNos:checked").each(
                         function(){ sendRequest( 'yourpage.asp', 'id='+$(this).val()+'&val='+ escape($(".edit_area", $(this).parent().parent().parent()).html()) );}
                  );
        }
     
Can you please assist me in making this function used in the submitForm() so that I can retrieve it on the  "list_save_proxy.asp" page.

thanks for your hlep


 function submitForm(frm, ax){

// requires jquery 

        $('#action').val(ax);

        var myForm = $("#" + frm);

                var param="";

                $(".edit_area").each( function(){param+= "," + escape(this.innerHTML) });

                param = "itemNotes=" + param.substring(1);

 

        var frmParams = myForm.serialize() + "&" + param;

         

                $.ajax({

                 type: "POST",

                url: "list_save_proxy.asp", 

                dataType: "xml",

                data: frmParams,

                success: function(xml){

                                

                                var errCode = $("errorcode", xml).text();

                                var errMsg = $("errormsg", xml).text();

                                var resTxt = $("responsetext", xml).text();

                                

                                if(errCode == 0){

											if(resTxt =="exist"){

											  if(confirm('List Name Already exist, Do you want to over write it?')){

												   submitForm('frmList', 'savefields');  

												   $("#hiddflag").val('4');

												}

											 }else{                                

												$('#responsemsg').html(resTxt);

												repopulateList();

											}	

								}else{

                                        $('#responsemsg').html('\n<br> > ' + resTxt + '');

                                        $('#responsemsg').append(' [' + errCode + ' ' +  errMsg + ']'); 

                                }

                            }  

        });

        }

 

Open in new window

0
 
LVL 82

Expert Comment

by:hielo
ID: 21789520
If I had to guess, most likely your submitForm will send your entire form, not just the rows that are selected. With this:
  function getSelected()
        {
               $("input.chkRefNos:checked").each(
                         function(){ sendRequest( 'yourpage.asp', 'id='+$(this).val()+'&val='+ escape($(".edit_area", $(this).parent().parent().parent()).html()) );}
                  );
        }

sentRequest() is being called with some script name and the 'potential' parameters for that function. So in sendRequest you will need to send an ajax request every time it is called.
0
 
LVL 8

Author Comment

by:newbie27
ID: 21789751
Hielo,
I think I am doing something wrong, please can you have a look at this

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_23486091.html

http://213.253.134.6/artism/admin/list_admin.asp

when i wanted to view existing list details, by  chosing it from the drop down, it is processing for the first time but when I wanted to view another list, its getting the list of record ids back but its not sending it to process to save_proxy.asp
please advice
thanks
0
 
LVL 82

Expert Comment

by:hielo
ID: 21799630
Most likely because of the dynamic javascript you are trying to insert. Read my comments on your other problem.
0
 
LVL 8

Author Comment

by:newbie27
ID: 21801451
I have Hielo but still it is not calling proxy.asp when you chose the list for the second time....
please can you look into this again..
thanks
sam
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 8

Author Comment

by:newbie27
ID: 21803999
Heilo,
If you hit this page and try to  view the list
http://213.253.134.6/artism/admin/list_admin.asp

it is not working at all, but when I go back create some default cookie list and comes back to this page i can then view any other list for only first time and then it is behaving the same...

please hielo can you look into this

thanks
s
0
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 21804427
before you make the ajax request you will need to "destroy/blank out" the previous table.
0
 
LVL 8

Author Comment

by:newbie27
ID: 21804537
Yes that worked, many thanks for your help Hielo.
I am hoping the jEditable column data will remain the last thing on this page
please can you not advice how to make this function post the value the save_proxy.asp page so that I can save the data correctly in the xml file.

for an instance:

<lists>
<username>test@test.com</username>
<listitem>
<listname>test6</listname>
<listnotes>test</listnotes>
<listrefs>
e2007092018174409,e2007092018105659
</listrefs>
<itemnotes>
notes,changed
</itemnotes>
<last_updated>20080616|18:07:52</last_updated>
</listitem>
</lists>
function getSelected()

        {

               $("input.chkRefNos:checked").each(

                         function(){ sendRequest( 'yourpage.asp', 'id='+$(this).val()+'&val='+ escape($(".edit_area", $(this).parent().parent().parent()).html()) );}

                  );

        }

Open in new window

0
 
LVL 8

Author Closing Comment

by:newbie27
ID: 31467379
thanks
0
 
LVL 8

Author Comment

by:newbie27
ID: 21804581
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now