1. #21
    Sencha Premium Member
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    330
    Vote Rating
    1
    PranKe01 is on a distinguished road

      0  

    Default


    Thanks for your hint with the seconds I would never have found this "bug"
    I changed the line 880 to the following:
    Code:
    return Ext.value(record[combo.displayField || combo.valueField], " ");
    Because, if someone sets the displayfield it will be used, else the valuefield. And if the displayfield is an empty string, than this should be displayed!
    A good example is, when I got a combobox, with an empty string to display, but another value to use.

    The "c" is mostly used, when working with webservices (.net). The databases mostly uses dateTime to save dates. But you are right - not all formats can be added in the adapter.

  2. #22
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    Hmm, it's difficult... don't know how I would look if I had the chance to select an empty item... I wouldn't know, what I select..... even more if there are two or more empty items (with different values, which you don't see).... to allow to select nothing instead of an empty item, I would make the combo {allowBlank:true,editable:true}.....
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  3. #23
    Sencha Premium Member
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    330
    Vote Rating
    1
    PranKe01 is on a distinguished road

      0  

    Default


    First of all it didn't make sense to have 2 items with the same displayvalue and different values. But I got an example where my template makes sense:
    (value, displayvalue)
    'None', ''
    'Mr', 'Mr.'
    'Ms', 'Ms.'

    With your template "None" would appear int the combo, which is not wanted, because the displayfield is set. If the displayfield is not set, then the value can be used.

  4. #24
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    Yes, I know, but it IS possible to have same displayValues... makes no sense, of course.
    I think, to select none (no item), the user has to clean the combo and the list should only contain Mr and Mrs.
    Btw, what is someone, who isn't Mr or Mrs?
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  5. #25
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    Anyhow, I updated the file with this. You convinced me It's odd to display some item's displayField values and some other's valueField values in the same list, which was possible with the old version....
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  6. #26
    Sencha Premium Member
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    330
    Vote Rating
    1
    PranKe01 is on a distinguished road

      0  

    Default


    It's a person, which does not set this field :P And in my case, I created the combobox like a select in html. So the user can't write anything. On the other hand I don't know why the value should be displayed, when a displayvalue is set oO

    Edit: Yeah

  7. #27
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    Convinced! See post above It's better.... hmm... ... yes, I think, it is........ it is!
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  8. #28
    Sencha User
    Join Date
    Apr 2008
    Posts
    330
    Vote Rating
    0
    Jack_S is on a distinguished road

      0  

    Default Addtions - Considerations

    Addtions - Considerations


    Hello Makana,

    Been following a lot of your posting on Air. I'm currently running your version of SQLiteStore using 'conn' parameter to avoid opening new connection to the db.

    All works well, inclusing my templates I few things I would consider adding to the air-debug.js would be the following.

    I'm still having problems with sql based and 'WHERE' clause store loading and I believe this is a pretty uuseful thing for all people, as there seems to be some problem with loading the store with the 'where' & 'args' params.

    http://www.extjs.com/forum/showthread.php?t=55024

    I would gladly assist but i'm anOracle DBA :-( and my programing skills are less then proficient.

    Maybe the question is where or not anybody has successfully implemented 'WHERE' clause in a combobox store load?

    Thanks in advance for all consideration and code sharing.

    Jack

  9. #29
    Sencha Premium Member
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    330
    Vote Rating
    1
    PranKe01 is on a distinguished road

      0  

    Default


    Hi,

    how do I use the conn-property? Am I right, that this would speed up the database-usage?

    Is that the right usage?
    Code:
    var conn = Ext.sql.Connection.getInstance();
    conn.open(dbFile);
    db = new Ext.sql.SQLiteStore({
    	conn: conn,
    	key: 'ID',
    	tableName: 'Benutzer',
    ...

  10. #30
    Sencha User
    Join Date
    Apr 2008
    Posts
    330
    Vote Rating
    0
    Jack_S is on a distinguished road

      0  

    Default


    Hello Pranke,

    As Makana stated in another post, what he does is create a namespace for the DB and then instanciates it.

    Code:
     Ext.ns('App.DB');
      App.DB = new Ext.sql.AirConnection();
      App.DB.open("myPathToMyDbFile.db");
    Then instead of using the dbFile param you would use the conn param as such:

    Code:
    store: new Ext.sql.SQLiteStore({
                                           conn: iApplication.module.DB
    					 //dbFile: 'db/Local.sqlite'
    					,key: 'period_id'
                                            ,tableName : 'ORI_PERIODS_ALL'
    					//,viewName :optional view param 
    					,fields: [ 
                               		{name: 'id', type: 'int', mapping: 'PERIOD_ID'}
                              		,{name: 'name', type: 'string', mapping: 'PERIOD_NAME'}
                        ]
    This has the benefit that you only open 1 connection to your SQLite database, and you can close it also with one command (not sure if this is correct coding, but should be):

    Code:
    App.DB.close();
    Jack