1. #1
    Ext User
    Join Date
    Sep 2007
    Posts
    104
    Vote Rating
    0
    robin30 is on a distinguished road

      0  

    Default Ext.MessageBox.alert problem

    Ext.MessageBox.alert problem


    hi all,

    i'm using startmenu desktop 2.0. in here i have a grid that shows bill that still needs to be paid or are already paid.

    i also made it that when bills are due for example tomorrow and a the ext.MessageBox.alert will show up and mention it.

    now my problem is this.

    when there are for example 2 bills due tomorrow, in the ext.MessageBox.alert it will say Electricity $200, trash $134.

    how can i get rid of the ','
    see attachment.

    this is my code to get what bills are due:

    PHP Code:
    billdue = new Ext.data.Store({
                       
    proxy: new Ext.data.HttpProxy({
                       
    url'php/database.php'
                       
    }),
                       
                       
    baseParams:{task"BILLDUE"},
                       
                       
    reader: new Ext.data.JsonReader({
     
    root'results',

                
    totalProperty'total',

                
    id'id'                   
                       
    },['id','name','amount','due'])
                       });
    billdue.load();
    billdue.on('load',function() {
    var 
    name = [];
    for(
    0ibilldue.getCount(); i++){

              
    name.push(billdue.getAt(i).data.name ' - $' billdue.getAt(i).data.amount '    Due:' billdue.getAt(i).data.due +'<br>');
              
               }
            
    Ext.MessageBox.alert('Bills Due !!','the following bills are due: <br><br><b>' name '</b>');            
            }); 
    thanks in advance,

    Robin30
    Attached Images
    Last edited by brian.moeskau; 2 May 2008 at 9:09 PM. Reason: moved to 2.0 forum as requested

  2. #2

  3. #3
    Ext User
    Join Date
    Sep 2007
    Posts
    104
    Vote Rating
    0
    robin30 is on a distinguished road

      0  

    Default thanks

    thanks


    thanks for your answer,

    but if i do this,

    PHP Code:
    Ext.MessageBox.alert('Bills Due !!','the following bills are due: <br><br><b>' name.shift() + '</b>'); 
    only the first one will show up. for example only electricity and not trash.

    Thanks again.

    really appreciate your help.

    Regards,

    robin

  4. #4
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    You built an array, name. Then you concatenate it, so it converts the array to a string (including the comma delimiters).

    Look at the description I sent you, it says
    The shift() method is used to remove and return the first element of an array.
    I'm not saying either is a solution, I was more pointing you towards to the basis of your problem.

    I think I may have approached it differently:

    PHP Code:
    var bills '';

    for(
    0ibilldue.getCount(); i++){
       
    bills += billdue.getAt(i).data.name ' - $' billdue.getAt(i).data.amount '    Due:' billdue.getAt(i).data.due +'<br/>';
              
               }
            
    Ext.MessageBox.alert('Bills Due !!','the following bills are due: <br><br><b>' bills '</b>'); 

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    2
    Vote Rating
    0
    brian.moeskau is an unknown quantity at this point

      0  

    Default


    Same concept, slightly optimized:
    Code:
    var msg = 'The following bills are due: <br>';
    for(i = 0, len = billdue.getCount(); i < len; i++){
        var bill = billdue.getAt(i).data;
        msg += ('<br><b>' + bill.name + ' - $' + bill.amount + '    Due:' + bill.due +'</b>');
    }
    Ext.MessageBox.alert('Bills Due !!', msg);

  6. #6
    Ext User
    Join Date
    Sep 2007
    Posts
    104
    Vote Rating
    0
    robin30 is on a distinguished road

      0  

    Default thanks guys

    thanks guys


    ugh, why do i always have to think difficult when it can be done simple? lol

    It works,

    Appreciate your help guys.

    Thanks,

    Regards,

    Robin30

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi