Refresh dataset after deleting photo?

Hello,
I have created a photo-manager-on-steriods (aka ajax) for my
spry photo gallery.
My setup is as follows:
var dsTours = new Spry.Data.XMLDataSet("xml_datasource.php",
"tours/tour", { useCache: false } )
var dsGalleries = new
Spry.Data.XMLDataSet("galleries/galleries_xml.php",
"galleries/gallery");
var dsGallery = new
Spry.Data.XMLDataSet("galleries/gallery_xml.php?tour_id={dsTours::id}",
"gallery");
var dsPhotos = new
Spry.Data.XMLDataSet("galleries/gallery_xml.php?tour_id={dsTours::id}",
"gallery/photos/photo", { useCache: false } );
Basically, I have a list of "Tours". There is a gallery for
each tour. when I select a tour, it displays the gallery for that
tour. This setup is packed into tabbed panels, but i doubt that is
relevant.
I have the thumbnails of the current gallery displayed in a
modified version of the preview thumbnail box of the photogallery
demo. Under each thumbnail, there is a delete button.
Currently, this button "onclick"s to:
function deleteGallPic(picID)
if(confirm("Are you sure you want to delete this photo?")){
Spry.Utils.loadURL("POST",
"config/delete_gallPic.php?pic_id=" + picID, true,
deletePicCallback);
with "deletePicCallback" being:
function deletePicCallback(req)
dsPhotos.loadData();
THE PROBLEM(s):
When I click on the delete button, it reloads the whole page
(defeats purpose!?) and resets the row number of "dsTours", and
thus the photo gallery being displayed is not the one I was working
on.
Also, sometimes it takes up to four clicks (not
click-click-click) of the delete button for the photo to be
deleted.
What i want is that when I click the delete button, the
function sends a behind-the-scenes request to the deletion file.
Once it has been deleted, I want only the dsPhotos (i think)
dataset to be reloaded. I don't see a reason for the page to reload
due to an ajax request.... anyways, I've been struggling with this
for some time, and would really appreciate someone's help.
PS: Why is it that, when I send a request using the "POST"
method, I can't recieve the variables using $_POST['foo'] ?
How do I go about sending them via post?
Thanks in advance,
Maquelly

Hi Maquelly,
Change your line:
Spry.Utils.loadURL("POST",
"config/delete_gallPic.php?pic_id=" + picID, true,
deletePicCallback);
to:
Spry.Utils.loadURL("POST", "config/delete_gallPic.php", true,
deletePicCallback, { postData: "pic_id=" + picID, headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
That should fix the problem where you aren't able to access
via the $ _POST array in php.
I'm a bit puzzled as to why your entire page changes. Is the
button underneath image a submit button?
<input type="submit" ... />
Or a normal button?
<input type="button" ... />
--== Kin ==--

Similar Messages

  • Camera roll not reducing size after deleting photos

    My camera roll stays the same size even after deleting 600 photos - I'm trying to still keep the roll included in my iCloud backup but had to size it down because the backups were too large and stopped without upgrading my storage. Why is this happening?

    PhotoStream does not use up your iCloud storage.
    Transfer your photos to your computer.  Then delete them from the iPhone.
    What steps are you having issues with?

  • After deleting photos, memory in my iPad is still used. WHY?

    When connecting my iPad mini to iTunes on my MacBook Air it shows that I have 2489 pictures on the iPad and am using 28.4 GB for all those pictures. When I open the Photos app on my iPad it shows that I do not have ANY pictures on the iPad, which would be correct, as I have deleted them all. So why are they still using up all that memory? How can I clear the memory to make it available again? BTW, My iPad Settings>General>About agrees with iTunes. It shows that I have 2452 pix (why not 2489 as above?), and am using 28.4 GB for them. So again, HOW CAN I CLEAR THE UNUSED MEMORY, or get rid of the pix if they are indeed still hiding somewhere on my iPad?
    My iPad mini is running iOS 8.1.1
    Thanks for any help....

    Hi, Tahunga,
    May be you need to do a comprehensive first.
    Firstly, be aware that the phone can sometimes take a while to update free space after deleting large items. I have often wondered whether iOS is making the user experience a bit 'nicer' by reporting the item deleted instantly, while doing the actual deleting in the background. Or perhaps its just the time taken to update databases used to record/report used/free space. In any case, try giving it a few minutes (maybe an hour) and see if its 'settled down'.
    Next up, in the Photos app, check the albums 'tab'. Is the camera roll reporting entirely empty? Are there any other albums?
    Finally, plug the iPad into your computer, and open up an app like Apple's Image Capture or whatever you use on Windows/Mac/Linux to import photos from a camera. Check that there's actually no photos in the 'camera' that is your iPad. After clearing out my pad, I found a bunch of small, unreadable movie files and a few photos left over in this app. I don't know how or why, given the iPhone wasn't showing them, but they were clearly taking up space. You may have somehow ended up with a lot of these.

  • Problem regaining memory space after deleting photos

    While on vacation, I copied 9 mb photos, in iPhoto albums, from a family member's Mac to my iPad 2 . Once back home, I deleted the albums and photos using my own computer.
    Even though the photos are now gone, my iPad still shows that I have 9 mb of photos.  So, even though the photos are not showing up on my iPad, the disk space is still reserved for the deleted photos.  How do I get it to give me the disk space back?  I no longer have access to the other Mac (that uploaded the photos).
    It was difficult to delete those photos as there were several thousand in a variety of folders.  I ended up syncing to my own iPhoto which had very few photos. That did remove the albums & photos, but did not give back the 9 mb of memory they resided in.
    Any ideas?
    Thanks.

    Not related ... but may be related ...  Here's my problems:
    Okay ... so, because I had less than a 1 Gig left (as reported by iTunes) on my 64Gig iPad, and the majority of the space was being used by "Photos" ... I decided to not keep my PC photos directory in sync with my iPad (Windows 7). So, in iTunes, I unchecked the option to sync computer photos to the iPad. I got the standard popup warning message that my iPad would not contain those albums after the next sync. I clicked OK and proceeded to sync expecting to have lots of space freed up.
    But weird things happened after syncing.
    (1) I still have all my photos on my iPad .... nothing disappeared at all. (And performed multiple syncs to try to force the change ... still nothing has been removed from my iPad.)
    (2) Somehow, I gained 20 Gigs of free space, as reported by both iTunes and my iPad as well.
    Anyone know what's going on here?
    I do have iMovie and another movie making app, Avid. Both of these contain projects that refer to photos in albums that were supposed to be removed after the sync ... but I can't imagine that would keep them there. Anyone have any ideas?
    I also installed the iPad app, iPhoto. I noticed that it build a directory listing and continuously want to update that listing from time to time.
    Would any of these things cause the iTunes photo sync changes to be ignored? And, how did I get free space to report back with an additional 19Gig or so, when there's no change at all.
    Unsure what's going on ...

  • Iphoto freezes after deleting photo

    I have an issue after installing the newest version of iphoto. Everything seems to be working fine except when I attempt to delete a photo the application stops responding.

    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    Regards
    TD

  • Nokia 6303 restart after deleting photo + media pl...

    I have a problem with a nokia 6303.
    After taking a photo and deleting it -> I pressed options and the phone restarted
    Is it a software bug? or?
    At the Menu media.. if I go to the Media player and there is no song "preloaded"
    (ie a previous listened) the media player stucks.. the phone has to be restarted
    to be able to play music again. This seems like a sofware but... I hope it will be fixed soon.
    Also the phone makes a background noise when the screen is light up

    milarepa wrote:
    I have a problem with a nokia 6303.
    After taking a photo and deleting it -> I pressed options and the phone restarted
    Is it a software bug? or?
    At the Menu media.. if I go to the Media player and there is no song "preloaded"
    (ie a previous listened) the media player stucks.. the phone has to be restarted
    to be able to play music again. This seems like a sofware but... I hope it will be fixed soon.
    Also the phone makes a background noise when the screen is light up
    Photo Problem:  When you opened the picture and then deleted it , the picture was still in memory and when the menu tried to go back one step the picture was no longer there so reset the phone.  Bug? Don't know, I would suggest that if you want to delete files do so in list view not whilst viewing the file you want to delete.  If you tried to do this in windows it would give you an error messaeg something like "this file is in use"
    Media PLayer Problem:  This could be down to Software, it could also be down to a memory card read error.
    Try taking card out and using a memory card reader check that all files are readable.  If one of the files is corrupt the media player may be trying to look for files to add to playlist and when it gets to the corrupt one bombs out.
    Gadget
    Message Edited by gadgetdude on 05-Jun-2009 03:48 PM
    Remember to mark all correctly answered questions as Solved. A forum is only as great as the sum of its parts, together we will prevail.

  • Refreshing dataset in Spry photo demo

    Hi everyone, only recently discovered Spry, it looks great so
    far.
    I have come across a problem I havent been able to resolve;
    In the demo application of the Photo Gallery, I want to
    create a button, that 'reloads' the core data i.e. the albums list.
    Is there a simple way of doing this? In my app, the albums change
    outside the gallery, and I effectively want a refresh button
    without having to reload the entire page. I'm currently getting
    around caching by using a JS random number in the XML url.
    Any help much appreciated :)

    Hi Don, you're a star!! It works perfectly!
    I have one more query (sorry!).
    In my setup I occasionally encounter 2 other scenarios.
    The first is when a user doesn't have any albums. The second
    is when the user has an album(s) but an album doesn't have any
    images within it.
    Is there anyway this could be dealt with from a Spry point of
    view. Ideally I would like it to say something like - You don't
    have any albums / Album contains no pictures.
    Ive got as far as providing an empty album xml, to which spry
    remains silent without errors (which is good) but I would like it
    to say ' There are no albums' or something similar.
    A shove in the right direction would be greatly appreciated.
    Thanks for your help and patience.

  • Unable to free storage space after deleting photos on iphone 4s and ipad mini

    Four hours later and I give in.
    I've downloaded, then deleted all photo and video content from devices - including from 'recently deleted' etc.
    Deleted and disabled icloud backups on both devices.
    Still, the usage remains on both devices, and itunes.
    But there are NO photos on either device.
    Anyone. ANYONE OUT THERE HAVE A SOLUTION????? AAAAAAAARRRRRRGGGGGHHHHHHHhh...........!!!!

    Thanks AmishCake.
    But, yes i've already tried the ol' trusty reset, to no avail

  • Cannot export from iPhoto after deleting photos in its library

    ... because it says it cannot find the original. It asks if I want to search for it myself, but I think it means searching for the ones I've deleted or something. I don't even want to upload those! Help!
    I've read this somewhere else on this forum: "The ! or ? turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents."
    That's exactly what's happening! Why?

    create a new deafult iPhoto preference file - quit iPhoto and go to "your user name" ==> library ==> preferences ==> com.apple.iPhoto.plist and trash it - launch iPhoto which creates a fresh new default preference file . If you make any changes to it make a note of what chane syou have made.
    Do NOT change the preference to copy imported items to the iPhoto library
    depress the option key and laynch iPhoto and create a new library
    Do not ever make any change to its content or structue using the finder or anyother program other than iPhoto
    in iPhoto under the hlep menu go to the iPhoto help videos and watch them
    Import a few photos and practice with iPhoto and ask specific question as you find things you do not understand
    Most important is to never go directly into the iPhoto library - there is no need to and ther are no user servicable parts in it
    LN 

  • ITunes not syncing after deleting photos via Windows Explorer

    Hi,
    I've got an iPhone 4 and recently filled it up with vids and pics on holiday. When i plugged the phone into my PC i copied all of the items from my iPhone via Windows Exploer (very handy i thought). Once i got a copy of everything, i deleted them via Windows Exploer
    Unfortunately when i opened iTunes later that day i noticed that even though there were no more photos or videos on the iPhone, iTunes still shows 3.3GB used for photos and 6.2GB used for videos.
    How on earth do i tell iTunes do update it's database?

    Welcome to the discussions,
    did you try to take another photo and connect the phone again to iTunes?
    Did you try to reset the phone by holding the sleep and home button until the Apple logo comes up again?

  • How do delete photos from iphone after import to new photos app?

    With iphoto (or aperture which I own), after importing photos I was always asked if I wanted to remove the photos's from my phone. With the new photo's app I don't get that option, and I certainly don't want to delete 1200 photos by having to individually select each one on the phone. Any ideas?

    You should ask on the forum that Apple told you to use for Beta software discussions. This isn't the place. The moderators will likely soon remove your post.

  • How can i restore memory after deleting all photos on my iPad 8.1.2

    iPad 4
    8.1.2
    Photos; not iPhoto app
    Under GENERAL I cannot restore my capacity memory after deleting all my photos from the iPad.
    I do not store photos in the Cloud. I do not use Photo Stream
    I have reset my iPad as well as checked in Image Capture for possible photos still there.
    I have also deleted last 30 days of photos.

    In iOS 8.1.2 photos that are deleted from the Camera Roll are moved to the Recently Deleted album. They remain there for 30 days unless you delete them again from that album. The Recently Deleted album was created because so many people complained that they deleted photos and wanted them back. The Recently Deleted album gives people 30 days to change their mind about deleting photos. For the rest of us, it's kind of a pan to have to delete the photos twice to free up the storage space.
    Oh, and there is no longer an iPhoto that works on iOS devices running iOS 8.1.2.

  • How to refresh after delete the records in ALV report ?

    Hi Friends,
    How to refresh after delete the records in ALV report.
    I am deleting records in ALV report .
    After successful delete the screen should refresh.
    u201C Deleted records should not appear in the screen u201C.
    Please guide me.
    Regards,
    Subash

    Hi subhash,
    FORM user_command USING r_ucomm LIKE sy-ucomm      rs_selfield TYPE slis_selfield.
    WHEN 'BACK'.
    Refresh the internal table from the ALV grid
          PERFORM update_alv_tab.
    ENDFORM.                    "user_command
    FORM update_alv_tab .
      DATA :  e_grid TYPE REF TO cl_gui_alv_grid.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = e_grid.
      CALL METHOD e_grid->check_changed_data.
      "update_alv_tab
      CALL METHOD e_grid->refresh_table_display.
    ENDFORM.                    " UPDATE_ALV_TAB
    Then see in Debug mode is it updating or not..
    Please confirm .
    And please paste the code if you can.
    Regards.

  • How do I get more space to update my iPhone 4 to iOS7? I am currently on iOS 6.1.3 with 6.3 GB capacity, 1.4 GB available AFTER deleting all apps, photos, music, and videos, and I need 3.8 GB.

    How do I get more space to update my iPhone 4 to iOS7? I am currently on iOS 6.1.3 with 6.3 GB capacity, 1.4 GB available AFTER deleting all apps, photos, music, and videos, and I need 3.8 GB.

    Update using iTunes on your computer. The space requirement does not apply because of how the process works via iTunes as opposed to over the air.

  • Pictures in "photos" tab (sidebar) are still present after deleting from original album.

    After importing my library from iPhoto to photos (Version 1.0 (209.52.0)), i deleted a large number of photos from one of my events (now an album). In this album i can only see the photos which i wanted. However when i select the "photos" tab at the very top of the sidebar, the deleted photos are still able to be seen. They are not in the 'recently deleted' section either. How do i permanently delete them? Should i remove them from the "photos" tab, or from the "all photos" album?
    There also seem to be many duplicated photos in my library after the importing. Is there an easy way to find and remove the duplicates?
    Thanks.
    Working on a MBP 13 inch (mid '12) with 2.9 GHz Intel core i7, 8GB memory and 1TB hard drive.

    Deleting them from the "Photos" tab will delete them. (actually, it will move them to the "deleted items" area, where they'll be permanently deleted after 30 days).
    The duplicates could be for one of two reasons:
    1) The photo was in your library and in your photo stream. It's possible this is causing some duplication
    2) You could have actually had lots of duplicates in your iPhoto library, and this is just easier to see in Photos

Maybe you are looking for