Sigma Php Ajax framework, Ajax Components, GUI Builder
May 23, 2012, 08:52:48 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Bugs/Error in removing same data in list  (Read 640 times)
jovibals
Hero Member
*****
Posts: 133


View Profile
« on: January 17, 2010, 08:42:10 PM »

hi linb please observe this example i had. I tried selecting the same dates and display it in listbox. then, Removing same dates in listbox doesn't take effect. Is this a bug or an error?


Class('App', 'linb.Com',{
    Instance:{
        iniComponents:function(){
            // [[code created by jsLinb UI Builder
            var host=this, children=[], append=function(child){children.push(child.get(0))};
           
            append((new linb.UI.DatePicker)
                .host(host,"datepicker1")
                .setLeft(40)
                .setTop(60)
                .afterUIValueSet("_datepicker1_aftervalueupdated")
            );
           
            append((new linb.UI.List)
                .host(host,"list3")
                .setLeft(260)
                .setTop(60)
                .setHeight(180)
                .setValue("a")
            );
           
            append((new linb.UI.Button)
                .host(host,"button9")
                .setLeft(260)
                .setTop(250)
                .setCaption("Remove")
                .onClick("_button9_onclick")
            );
           
            return children;
            // ]]code created by jsLinb UI Builder
        },
        events:{},
        iniResource:function(com, threadid){
        },
        iniExComs:function(com, hreadid){
        },
        _button9_onclick:function (profile, e, src, value) {
             var i = this.list3.getUIValue();
            this.list3.removeItems(i);
        },
        _datepicker1_aftervalueupdated:function (profile, oldValue, newValue) {
            var d = newValue;
            var newdateresult = linb.Date.get(d,"m") + 1 + "/" + linb.Date.get(d,"d") + "/" + linb.Date.get(d,"y");
             this.list3.insertItems(newdateresult );
        }
    }
});
Logged
linb
Administrator
Hero Member
*****
Posts: 435


View Profile
« Reply #1 on: January 19, 2010, 01:03:50 AM »

You have to set uniqe id to each item.
Logged
jovibals
Hero Member
*****
Posts: 133


View Profile
« Reply #2 on: January 19, 2010, 02:20:33 AM »


       Okay i understand that it should be unique and maybe there is a coding logic in here to validate each date to be selected so that it avoid duplication.

       and linb, can you please write an example that use datepicker and once you click for a particular date let say "january 20" belongs to a day of "wednesday"  all wednesday of month will display. Maybe this example could help also as reference.

Thank you.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!