UISectionList "launching" an alertSheet

Discussion in 'Jiggy Runtime Development' started by spoonforknife, Jul 1, 2008.

  1. spoonforknife

    spoonforknife Retired Moderator

    Joined:
    Nov 15, 2007
    Messages:
    6,896
    Likes Received:
    317
    YAY! It works.

    Please Register or Log in to view images



    I have no idea how to make a UISectionList do anything at all.
    Code:
    var states = 
      [
        "Accelerometer Log","AdBlock","Advanced Prefences","AFC2 Enabler","AirHockey","Alarm","Amaze-on","AMaze!","AMR Encoder + Decoder","Ants", "Apache","APlogger","AppFlow","Apple Screenshot Enabler","Apps Launcher","Apollo","Aquariam","AsVibra","AsVibra2","Audio Amp","Av","AVPlayer","AvTracks",
        "Backgammon","BallFight","Balls","Band","Banner","Bard","Battery Info","Battery Status","BBInfo","Beat Phone","Bettys Cookbook","BigClock","b*tchX","BiteSMS","BladeEnc","Blinker","BlockPuzzle","Bluetooth","Bonk","Bookmarklets","Books","BootNeuter","BossPrefs","BossTool","Bounce","BSD Subsystem 2.0 Term Fix","BSD Subsystems","Burp","Butterfly","Bzip2",
        "Caissa","CalcPaper","CallD","CallData","Call History Patch","CamEnabler","CameraPro","Capture","Categories","Cave","Chemistry Reference Table","Chess","Chuzzle","Clear SMS","ClickOnce","Collage","ColloQ","Colloquy","ColloquyJ","CommandX","Community WebClips","Compass","Contact Flow","Contacts","ContraSense","Convert","Converter","Cracks","CrossWalk","Crossy","CubeWorld","Customize","Cydia",
        "Dali Clock","DashBuster","DateConvert","Devicescape Connect","Dial 911","Dialers Launcher","DNS Tools","Dock","Dock Icon Reflection Remover","Docs","Documents Reader","Domino","Dress Up","DropCopy","DropTXT","Drum","Drummer",
        "Earth 3D","EasyButton","EDGE Fix","Elmo","Erica's iPhone Utilities","Erica's Manual","Erica's Ported Utilities","Erica's Utilities","Euro2008","EvolutionRGB","Excuses","ExportNotes",
        "Fab-Four","Fall","Feeds","File Browser","Findutils","FingerRun","Firefly Media Server","Firmware","FiveDice","Fix Rubrica +39","Flashlight","Flite","FontSwap","Freeboard","Fring","Frotz","FTi","Funambol","Funiculus",
        "Gameboy4iphone","Games Launcher","Gangsa","Garf","Gawk-ja","GemLogic","Genesis4iphone","GeoPedia","GeoStars","GIMD2Test","Gnuplot","GpsPhone","Graffiti","Greek Project","GuitarChords","Guitarist","Guitar Tuner",
    "Halloween","HapticKB","HandicApp","HidePod","HistoryDL","Hockey","Homework","HP-11C","HP-12C","HP-15C","HP-16C","HuaRongDao","Hum","HWInfo","HWPen",
        "I2Reader","I64","IAmp","IAthan","IBible","IBingo","IBirthday","IBlackjack","IBrainfsck","IBrate","IBurpz","ICalls","IChabber","IChinese","ICopter","ICountdown","ICrossword","ICube","IDeleteMail","IDeutsch","IDial","IDialer","IDigger","IDope","IEatHalal","IFartz","IFlashcards","IFlickr","IFlight","IFlix","IFob","IFON","IGiggle","IGo","IGolfXP2","ILauncher","ILevel","ILight","ILauncher","ILevel","ILight","ILog","ILottery","ILoveInstaller","ILyrics","IMapIdle","IMatrix","IMemory","ImFlow","IMGrab","IMGSaver","ImgZip","ImportNotes","IMoneyTrackin'","IMoon","INetServices","INewsGroup","INorris","Insomnia","InstaFresh","Installer","Intelliscreen","Interval","IP","IPac3D","IPark","IPHCalc","IPhoneHome","IPhoneSynth","IPhysics","IPI","IPickup Line","IPlot","IPod2","IPod3","IPodFix","IPod touch Dock for iPhone","IPong","IPokereval","IPowerHour","IPray","IPwnce","IQuickBlock","IQuiz","IQuran","IRadio","IRCm","IReadMail","IRection","IRemember","IRemote","Irssi","ISaber","ISendFile","IShare","ISIM","ISkebby","ISkype","ISlots","ISMS","ISnake","ISolitare","ISpit","ISteamy","IStrands","IStudy","ISwitcher","ITA","ITaste","ITerminal","IToday","IToggle","ITrac","IWomen","IXboxLive","IZoo",
        "Jalali Date","Jason Kit","Jam less","JCalc","JGoogle","Jiggles","Jiggy","Jiggy Runtime","Jiggy Weather","Jiggy Weather Celcius","JohnTool",
        "Karajan","Kate","KChanger","Kb","Kb2","KillBoard","KLores",
        "Labyrinth","LAME","Laps2Note","Launcher","LEDBanner","Leftover","Level","Lexitron","LHa for UNIX","LibFetion","Libiconv","Light","Lights Off","LightsOn","Lighttpd","Line-In Oscilloscope","Linux","LiveJournal","LiveScores","LocateMe","Locations","LockBox","Loo","LPlates","LumaQQ","Lv",
        "MACalc","Make It Mine","Magic","Magic8","Mahjong","Maps Offline","Marble","Melt","Metronome","Midterm","Mines","Mirrorscope","Mixup","MMiThemer","Mmpctl","MobileCast","MobileChat","MobileEnhancer","MobileFinder","MobileFinder","Mobile Flickr","MobileJuhu","MobileMoney","MobilePreview","MobileRSS","MobileScrobbler","MobileTextEdit","MobileToDoList","MobileTwitter","MobileZipCodes","Moleskine","Moo","MPG","Mrmr","MRTSchedule","Msmtp","Multitouch","Music Quiz","MxTube","MyERadio","MyMedia","MyTime","My eBay","My Launcher",
    "Navizon GPS","NemusSync","NES","Netcat","NetChess","NetServices","Nikotalkie","Nkf","NOIZ2SA",
    "Oblique","Ogg4iphone","OpenLLDP","OpenSSH","OpenTTD","OrbLive","Othello",
        "P-FireWall","Panic","Parking Lot","Parms Bookmarklets","PDFViewer","Penguin Panic","Pericam","Periodic Table","Perl","PhoneZap","PhotoBoard","PhotoDial","Pianist","Piano","Picocalc","Picomemo","Pieces","PigShooter","Pirate","Pocket Guitar","PocketMoney","PocketTouch","Poddle","Poke","PokerSolitarus","PowerTool","Psx4iphone","Pumped","Pumpkin","Pure-FTPd","Pushr","PuzzleManiak","Pysl","Python",
        "Quasi-Low Jack","Quest",
        "RainbowLight","Raging Thunder","Raptor","RealArtist","Reboot","RedLight","RemoteNote","Respring","Respring 2","Restart","Ringtones","RockFall","Rose","RRootage","RSS","RuBooks","RWallpaper",
        "SafariAddOn","Safaribm2stdout","Safarihist2stdout","Samba File Server","Sand","SB","ScreenShot","Scribble","ScummVM","Search","Sed-ja","SendFile","SendPics","SendSong","Sensors","Services","Shake","Shaver","ShopList","ShowTime","Skrew Common","SIMport","SimplifyMediaMobile","Sinewave","Sinwave","SiP-VoIP","Sketches","Skf","SkySMS","Sleigh","SmartRSS","SMSD","SMS Notify","Snake","Snapture","Snes4iphone","SongBird","SoX","SpeedDial","SpeedRun","Splitter","SpoofApp","SpringDial","Stacks","StatusStyle","Street Flow","Stumbler","Sudoku","Sudoku 1.0","Sudoku Plus","Sugar Tracker","SUID Lib Fix","SummerBoard","SuperPong","SwapBookmarks","SwapBT","SwapPhoto","SwapPlugins","SwapTunes","Swipe","SwirlyMMS","Switch-It","SysInfo",
        "T-Mobile Unlimited Edge Hack","T4Two","Tap Tap Revolution","Tapnumber","TapSearch","TapStereo","TapTheBeat","Tapp","Taskbar Notifier","TDClock","TeeVee","Term-vt100","Term Fix","Terminal","TextReader","Tetris!","Tetrominos","ThemeBuilder","ThemePreviewer","THTouch","Tic Tac Toe","Time4SMS","Time Capsule","TimeTracks","Tinyproxy","Tipper","ToDo","ToggleBacklight","*******ula","TouchLayer","Touchmods Contacts Demo","Touchpad Pro","TouchRoll","TouchPod","Towers of Hanoi","Transit","Treasuremytext","Tribal","Tris","Trism","Tumbler","TuneWiki","TuxPuck","Twinkle","TwistedFingers","Twitxr","TypeIt4Me",
        "Ulctl","Uncle","UnRAR","UnZip","UPoze",
        "Video Recorder","Vista","Visualize 2.0","Visualize 2.0 Version Number Fix","VoiceNotes","Vonagent","VNotes","VNSea","VWallpaper",
        "WallPaper","Waves","WDialer","Weather Icon Theme Fix","Web Search","WeDict","WeDict 1.1.3 Fix","WeFit","WeLLK","WeLyrics","WeMJ","WeSpot","WeSpot Package 1","WeSpot Package 2","WeStocks","WeTool","Wget","Whisper","Wifictl","WiFiSwitch","WifiToggle","Wiki2Touch","WildEyes!","World",
        "XClock","XLaunch","Xmas","XriPhone","Xtra Utils",
        "Yes-No", "Yeti3D","YouTube Activator",
        "Zip","ZodTTD Required Library","Zune2",
        "1.1.4 Cookie Fix","1.1.4-1.1.1 Baseband Downgrader","1.1.4-1.1.2 Baseband Downgrader","1.1.4-1.1.3 Baseband Downgrader","10x10","15","1Shoot","2tch","4Balls",
      
      ];
    
    var sectionTitles = [];
    
    var sectionRows = [];
    
    for( var i = 0; i < states.length; i++ )
    {
      var firstLetter = states[ i ].charAt( 0 );
      
      var sectionStart = false;
      
      if ( sectionTitles.length == 0 )
        sectionStart = true;
      else 
        sectionStart = firstLetter != sectionTitles[ sectionTitles.length - 1 ];
        
      if ( sectionStart )
      {
        sectionTitles.push( firstLetter );
        sectionRows.push( i );
      }    
    }
    
    var window = new UIWindow( UIHardware.fullScreenApplicationContentRect );
    
    window.setHidden( false );
    window.orderFront();
    window.makeKey();
    window.backgroundColor=[1 , 1 , 1 , 1];
     
    var listView = new UIView( window.bounds );
    
    window.setContentView( listView );
    
    var sl = new UISectionList( listView.bounds );
    
    listView.addSubview( sl );
    
    var table = sl.table;
    table.addTableColumn( new UITableColumn( "foo" , "bar" , sl.bounds[ 2 ] ) );
    table.separatorStyle = 1;
    
    table.rowHeight = 48;
    
    
    var cells = [];
    
    for( var i = 0; i < states.length; i++ )
    {
      var cell = new UIImageAndTextTableCell();
      cell.title = states[ i ];
      
      cells.push( cell );
    }
    
    
    sl.onGetNumberOfSections =  function( l ) { return sectionTitles.length; };
    
    sl.onGetSectionTitle = function( l , section ) { return sectionTitles[ section ]; };
    
    
    sl.onGetSectionRow = function( l , section ) { return sectionRows[ section ]; };
    
    sl.onGetNumberOfRows = function( l ) { return cells.length; };
    
    sl.onGetCell = function( l , column , row ) { return cells[ row ]; };
    
    sl.onRowSelected = function( l , row ) { log( "SELECTED:" + states[row] ); };
    
    sl.reloadData();
    Any help?
  2. iNoVaTe

    iNoVaTe Banned

    Joined:
    Jun 26, 2008
    Messages:
    59
    Likes Received:
    0
    Code:
    cell.onTap = function(event){
    alert("Selected : "+cell.tile);
    }
  3. spoonforknife

    spoonforknife Retired Moderator

    Joined:
    Nov 15, 2007
    Messages:
    6,896
    Likes Received:
    317
  4. iNoVaTe

    iNoVaTe Banned

    Joined:
    Jun 26, 2008
    Messages:
    59
    Likes Received:
    0
    just pu that at the end of your section list
  5. rob spriggs

    rob spriggs New Member

    Joined:
    Jan 26, 2008
    Messages:
    28
    Likes Received:
    0
    why not try and explain it to him, that way we all learn somthing, its too easy to just cut and paste over peoples code, i know, and im trying to get out of the habit.

    the second code throws up and alert box saying:

    Selected and also the the data that was in that cell

    however if you do put this in your code then that will be obvious
  6. spoonforknife

    spoonforknife Retired Moderator

    Joined:
    Nov 15, 2007
    Messages:
    6,896
    Likes Received:
    317
    Anyway to make it work on anything but the last section?
  7. godogshomie

    godogshomie New Member

    Joined:
    Nov 19, 2007
    Messages:
    558
    Likes Received:
    3
    ok i havn't done jiggy in forever

    Please Register or Log in to view images

    but i will help you...ok here is what you do

    First create an alert sheet

    there is a sample on the jiggyapp.com site

    after wards at the bottom of that code snippet before you call the table you add this
    Code:
    if(row==1){
    alertsheetname.popupAlertAnimated(true);
    }
     
    /*What this does is tell the table that when you tap on the cell numbered 0 it returns a function which you place between the brackets*/
    
    
    it should come out looking like this
    Code:
    var states = 
      [
        "Accelerometer Log","AdBlock","Advanced Prefences","AFC2 Enabler","AirHockey","Alarm","Amaze-on","AMaze!","AMR Encoder + Decoder","Ants", "Apache","APlogger","AppFlow","Apple Screenshot Enabler","Apps Launcher","Apollo","Aquariam","AsVibra","AsVibra2","Audio Amp","Av","AVPlayer","AvTracks",
        "Backgammon","BallFight","Balls","Band","Banner","Bard","Battery Info","Battery Status","BBInfo","Beat Phone","Bettys Cookbook","BigClock","b*tchX","BiteSMS","BladeEnc","Blinker","BlockPuzzle","Bluetooth","Bonk","Bookmarklets","Books","BootNeuter","BossPrefs","BossTool","Bounce","BSD Subsystem 2.0 Term Fix","BSD Subsystems","Burp","Butterfly","Bzip2",
        "Caissa","CalcPaper","CallD","CallData","Call History Patch","CamEnabler","CameraPro","Capture","Categories","Cave","Chemistry Reference Table","Chess","Chuzzle","Clear SMS","ClickOnce","Collage","ColloQ","Colloquy","ColloquyJ","CommandX","Community WebClips","Compass","Contact Flow","Contacts","ContraSense","Convert","Converter","Cracks","CrossWalk","Crossy","CubeWorld","Customize","Cydia",
        "Dali Clock","DashBuster","DateConvert","Devicescape Connect","Dial 911","Dialers Launcher","DNS Tools","Dock","Dock Icon Reflection Remover","Docs","Documents Reader","Domino","Dress Up","DropCopy","DropTXT","Drum","Drummer",
        "Earth 3D","EasyButton","EDGE Fix","Elmo","Erica's iPhone Utilities","Erica's Manual","Erica's Ported Utilities","Erica's Utilities","Euro2008","EvolutionRGB","Excuses","ExportNotes",
        "Fab-Four","Fall","Feeds","File Browser","Findutils","FingerRun","Firefly Media Server","Firmware","FiveDice","Fix Rubrica +39","Flashlight","Flite","FontSwap","Freeboard","Fring","Frotz","FTi","Funambol","Funiculus",
        "Gameboy4iphone","Games Launcher","Gangsa","Garf","Gawk-ja","GemLogic","Genesis4iphone","GeoPedia","GeoStars","GIMD2Test","Gnuplot","GpsPhone","Graffiti","Greek Project","GuitarChords","Guitarist","Guitar Tuner",
    "Halloween","HapticKB","HandicApp","HidePod","HistoryDL","Hockey","Homework","HP-11C","HP-12C","HP-15C","HP-16C","HuaRongDao","Hum","HWInfo","HWPen",
        "I2Reader","I64","IAmp","IAthan","IBible","IBingo","IBirthday","IBlackjack","IBrainfsck","IBrate","IBurpz","ICalls","IChabber","IChinese","ICopter","ICountdown","ICrossword","ICube","IDeleteMail","IDeutsch","IDial","IDialer","IDigger","IDope","IEatHalal","IFartz","IFlashcards","IFlickr","IFlight","IFlix","IFob","IFON","IGiggle","IGo","IGolfXP2","ILauncher","ILevel","ILight","ILauncher","ILevel","ILight","ILog","ILottery","ILoveInstaller","ILyrics","IMapIdle","IMatrix","IMemory","ImFlow","IMGrab","IMGSaver","ImgZip","ImportNotes","IMoneyTrackin'","IMoon","INetServices","INewsGroup","INorris","Insomnia","InstaFresh","Installer","Intelliscreen","Interval","IP","IPac3D","IPark","IPHCalc","IPhoneHome","IPhoneSynth","IPhysics","IPI","IPickup Line","IPlot","IPod2","IPod3","IPodFix","IPod touch Dock for iPhone","IPong","IPokereval","IPowerHour","IPray","IPwnce","IQuickBlock","IQuiz","IQuran","IRadio","IRCm","IReadMail","IRection","IRemember","IRemote","Irssi","ISaber","ISendFile","IShare","ISIM","ISkebby","ISkype","ISlots","ISMS","ISnake","ISolitare","ISpit","ISteamy","IStrands","IStudy","ISwitcher","ITA","ITaste","ITerminal","IToday","IToggle","ITrac","IWomen","IXboxLive","IZoo",
        "Jalali Date","Jason Kit","Jam less","JCalc","JGoogle","Jiggles","Jiggy","Jiggy Runtime","Jiggy Weather","Jiggy Weather Celcius","JohnTool",
        "Karajan","Kate","KChanger","Kb","Kb2","KillBoard","KLores",
        "Labyrinth","LAME","Laps2Note","Launcher","LEDBanner","Leftover","Level","Lexitron","LHa for UNIX","LibFetion","Libiconv","Light","Lights Off","LightsOn","Lighttpd","Line-In Oscilloscope","Linux","LiveJournal","LiveScores","LocateMe","Locations","LockBox","Loo","LPlates","LumaQQ","Lv",
        "MACalc","Make It Mine","Magic","Magic8","Mahjong","Maps Offline","Marble","Melt","Metronome","Midterm","Mines","Mirrorscope","Mixup","MMiThemer","Mmpctl","MobileCast","MobileChat","MobileEnhancer","MobileFinder","MobileFinder","Mobile Flickr","MobileJuhu","MobileMoney","MobilePreview","MobileRSS","MobileScrobbler","MobileTextEdit","MobileToDoList","MobileTwitter","MobileZipCodes","Moleskine","Moo","MPG","Mrmr","MRTSchedule","Msmtp","Multitouch","Music Quiz","MxTube","MyERadio","MyMedia","MyTime","My eBay","My Launcher",
    "Navizon GPS","NemusSync","NES","Netcat","NetChess","NetServices","Nikotalkie","Nkf","NOIZ2SA",
    "Oblique","Ogg4iphone","OpenLLDP","OpenSSH","OpenTTD","OrbLive","Othello",
        "P-FireWall","Panic","Parking Lot","Parms Bookmarklets","PDFViewer","Penguin Panic","Pericam","Periodic Table","Perl","PhoneZap","PhotoBoard","PhotoDial","Pianist","Piano","Picocalc","Picomemo","Pieces","PigShooter","Pirate","Pocket Guitar","PocketMoney","PocketTouch","Poddle","Poke","PokerSolitarus","PowerTool","Psx4iphone","Pumped","Pumpkin","Pure-FTPd","Pushr","PuzzleManiak","Pysl","Python",
        "Quasi-Low Jack","Quest",
        "RainbowLight","Raging Thunder","Raptor","RealArtist","Reboot","RedLight","RemoteNote","Respring","Respring 2","Restart","Ringtones","RockFall","Rose","RRootage","RSS","RuBooks","RWallpaper",
        "SafariAddOn","Safaribm2stdout","Safarihist2stdout","Samba File Server","Sand","SB","ScreenShot","Scribble","ScummVM","Search","Sed-ja","SendFile","SendPics","SendSong","Sensors","Services","Shake","Shaver","ShopList","ShowTime","Skrew Common","SIMport","SimplifyMediaMobile","Sinewave","Sinwave","SiP-VoIP","Sketches","Skf","SkySMS","Sleigh","SmartRSS","SMSD","SMS Notify","Snake","Snapture","Snes4iphone","SongBird","SoX","SpeedDial","SpeedRun","Splitter","SpoofApp","SpringDial","Stacks","StatusStyle","Street Flow","Stumbler","Sudoku","Sudoku 1.0","Sudoku Plus","Sugar Tracker","SUID Lib Fix","SummerBoard","SuperPong","SwapBookmarks","SwapBT","SwapPhoto","SwapPlugins","SwapTunes","Swipe","SwirlyMMS","Switch-It","SysInfo",
        "T-Mobile Unlimited Edge Hack","T4Two","Tap Tap Revolution","Tapnumber","TapSearch","TapStereo","TapTheBeat","Tapp","Taskbar Notifier","TDClock","TeeVee","Term-vt100","Term Fix","Terminal","TextReader","Tetris!","Tetrominos","ThemeBuilder","ThemePreviewer","THTouch","Tic Tac Toe","Time4SMS","Time Capsule","TimeTracks","Tinyproxy","Tipper","ToDo","ToggleBacklight","*******ula","TouchLayer","Touchmods Contacts Demo","Touchpad Pro","TouchRoll","TouchPod","Towers of Hanoi","Transit","Treasuremytext","Tribal","Tris","Trism","Tumbler","TuneWiki","TuxPuck","Twinkle","TwistedFingers","Twitxr","TypeIt4Me",
        "Ulctl","Uncle","UnRAR","UnZip","UPoze",
        "Video Recorder","Vista","Visualize 2.0","Visualize 2.0 Version Number Fix","VoiceNotes","Vonagent","VNotes","VNSea","VWallpaper",
        "WallPaper","Waves","WDialer","Weather Icon Theme Fix","Web Search","WeDict","WeDict 1.1.3 Fix","WeFit","WeLLK","WeLyrics","WeMJ","WeSpot","WeSpot Package 1","WeSpot Package 2","WeStocks","WeTool","Wget","Whisper","Wifictl","WiFiSwitch","WifiToggle","Wiki2Touch","WildEyes!","World",
        "XClock","XLaunch","Xmas","XriPhone","Xtra Utils",
        "Yes-No", "Yeti3D","YouTube Activator",
        "Zip","ZodTTD Required Library","Zune2",
        "1.1.4 Cookie Fix","1.1.4-1.1.1 Baseband Downgrader","1.1.4-1.1.2 Baseband Downgrader","1.1.4-1.1.3 Baseband Downgrader","10x10","15","1Shoot","2tch","4Balls",
      
      ];
    
    var sectionTitles = [];
    
    var sectionRows = [];
    
    for( var i = 0; i < states.length; i++ )
    {
      var firstLetter = states[ i ].charAt( 0 );
      
      var sectionStart = false;
      
      if ( sectionTitles.length == 0 )
        sectionStart = true;
      else 
        sectionStart = firstLetter != sectionTitles[ sectionTitles.length - 1 ];
        
      if ( sectionStart )
      {
        sectionTitles.push( firstLetter );
        sectionRows.push( i );
      }    
    }
    
    var window = new UIWindow( UIHardware.fullScreenApplicationContentRect );
    
    window.setHidden( false );
    window.orderFront();
    window.makeKey();
    window.backgroundColor=[1 , 1 , 1 , 1];
     
    var listView = new UIView( window.bounds );
    
    window.setContentView( listView );
    
    var sl = new UISectionList( listView.bounds );
    
    listView.addSubview( sl );
    
    var table = sl.table;
    table.addTableColumn( new UITableColumn( "foo" , "bar" , sl.bounds[ 2 ] ) );
    table.separatorStyle = 1;
    
    table.rowHeight = 48;
    
    
    var cells = [];
    
    for( var i = 0; i < states.length; i++ )
    {
      var cell = new UIImageAndTextTableCell();
      cell.title = states[ i ];
      
      cells.push( cell );
    }
    
    
    sl.onGetNumberOfSections =  function( l ) { return sectionTitles.length; };
    
    sl.onGetSectionTitle = function( l , section ) { return sectionTitles[ section ]; };
    
    
    sl.onGetSectionRow = function( l , section ) { return sectionRows[ section ]; };
    
    sl.onGetNumberOfRows = function( l ) { return cells.length; };
    
    sl.onGetCell = function( l , column , row ) { return cells[ row ]; };
    
    sl.onRowSelected = function( l , row ) {
    
    if(row==0){
    alertsheetname.popupAlertAnimated(true);
    }
    }
    sl.reloadData();
    
    then you go so on and so fourth like

    Code:
    if(row==1){
    }
    if(row==2){
    }
    
    Hope this is what you were looking for!!

    Please Register or Log in to view images





    EDIT: TRY THAT EDITED CODE
  8. spoonforknife

    spoonforknife Retired Moderator

    Joined:
    Nov 15, 2007
    Messages:
    6,896
    Likes Received:
    317
    Oh, so it is that easy!
    I thought of that too, but thought that was too simple.

    Please Register or Log in to view images


    Thanks!
  9. PAEz

    PAEz New Member

    Joined:
    Jan 29, 2008
    Messages:
    201
    Likes Received:
    10
    Or instead of having lots and lots of slow "if"s you could just create another array containing all of the urls for the repos and then do something like this.....
    Code:
    var urls= 
    [
    "someurl", "anotherurl", "blah", "blah", "bleh"
    ];
    
    sl.onRowSelected = function( l , row ) {
     log( "SELECTED:" + states[row] +" the url is:"+urls[row]); 
    };
    
    ....would save some typing and make your app respond faster.
  10. spoonforknife

    spoonforknife Retired Moderator

    Joined:
    Nov 15, 2007
    Messages:
    6,896
    Likes Received:
    317
    I could not get godoghomie's method to work at all, and I did indeed make the alertsheets beforehand. I included the alertsheets so I was sure that nothing was wrong with their format, and nothing was. Something is wrong with the code above.

    EDIT: Thanks! Got it to work!

Share This Page