Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30

Thread: Adding a Checkbox in a Grid row and connect it to JSON?

  1. #11
    Sencha User
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    OK, but linje also needs to be a grid plugin. Did you configure that?

  2. #12

    Default

    Quote Originally Posted by Condor View Post
    OK, but linje also needs to be a grid plugin. Did you configure that?
    plugins:[linje,new Ext.ux.grid.Search({
    mode:'remote',
    iconCls:false,
    dateFormat:'m/d/y',
    minLength:2,
    checkIndexes:['company_name','orgno']
    })],

  3. #13
    Sencha User
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    looks ok.

    Do you still have a problem (if yes, specify)?

  4. #14

    Default

    Quote Originally Posted by Condor View Post
    looks ok.

    Do you still have a problem (if yes, specify)?
    I am attaching a screenshot.

    It seems that all checkboxes are checked by default, even when 'active' (the dataindex) is 0 and TINYINT in the mySQL database.
    When I click on a checkbox, the value is not changed in the database.
    Attached Images Attached Images

  5. #15
    Sencha User
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    In javascript "0" == true.

    Either modify CheckColumn, so it understands "0" and "1" or make your server return true and false (what CheckColumn was meant for).

  6. #16

    Default

    Quote Originally Posted by Condor View Post
    In javascript "0" == true.

    Either modify CheckColumn, so it understands "0" and "1" or make your server return true and false (what CheckColumn was meant for).
    I try editing the database and setting aktiv to 0 and 1 in different rows, and it still shows as checked by default.
    I also verify this with JSON results, and it shows aktiv as 0 and 1 in different rows.
    So it seems that that's not the problem in this case.

  7. #17
    Sencha User
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    The JSON data example you posted contained aktiv:"0" (string, not number!).

    What does your JSON data currently contain?

  8. #18

    Default

    Quote Originally Posted by Condor View Post
    The JSON data example you posted contained aktiv:"0" (string, not number!).

    What does your JSON data currently contain?
    Ok, here's what Firebug is telling me:

    {"response":{"value":{"items":[{"aktiv":"1","company_id":"44","company_id2":"44","company_name":"Daniel Test","orgno":"123456789","firstname":"ASFsff","lastname":"dgfgf","address1":"dfg","postalcode":"2343","postalarea":"Moss","phone1":"45465654656","mobile":"","fax1":"","email":"[email protected]","www":"","bankaccount":"12345678912","password":"12345","activation_status":"Y","bransje":"Velg en bransje...","butikknummer":null,"kommentar":null,"butikk_navn":"","butikk_addresse":"","butikk_poststed":"","butikk_telefon":"","butikk_postnummer":"0","butikk_beskrivelse":"","butikk_epost":"","butikk_faks":"","apningstider_hverdag":"","apningstider_helg":"","stengetider_hverdag":"","stengetider_helg":""},{"aktiv":"0","company_id":"45","company_id2":"45","company_name":"dfhhgh","orgno":"454545456","firstname":"gfhghgh","lastname":"ghgh","address1":"gfgh","postalcode":"5656","postalarea":"ghghgh","phone1":"56556767667","mobile":"","fax1":"","email":"[email protected]","www":"","bankaccount":"12345678912","password":"12345","activation_status":"N","bransje":"Velg en bransje...","butikknummer":null,"kommentar":null,"butikk_navn":"","butikk_addresse":"","butikk_poststed":"","butikk_telefon":"","butikk_postnummer":"0","butikk_beskrivelse":"","butikk_epost":"","butikk_faks":"","apningstider_hverdag":"","apningstider_helg":"","stengetider_hverdag":"","stengetider_helg":""},{"aktiv":"1","company_id":"46","company_id2":"46","company_name":"sdgdfggf","orgno":"123456789","firstname":"dfdfhh","lastname":"gfhgfhg","address1":"fgh","postalcode":"4545","postalarea":"gfhghgf","phone1":"45645654654656","mobile":"","fax1":"","email":"[email protected]","www":"","bankaccount":"12345678912","password":"12345","activation_status":"N","bransje":"Velg en bransje...","butikknummer":null,"kommentar":null,"butikk_navn":"","butikk_addresse":"","butikk_poststed":"","butikk_telefon":"","butikk_postnummer":"0","butikk_beskrivelse":"","butikk_epost":"","butikk_faks":"","apningstider_hverdag":"","apningstider_helg":"","stengetider_hverdag":"","stengetider_helg":""},{"aktiv":"0","company_id":"47","company_id2":"47","company_name":"dfsgdsf","orgno":"333333333","firstname":"asdfsda","lastname":"dsafsd","address1":"dsfasdf","postalcode":"3333","postalarea":"dsafsdaf","phone1":"33333333","mobile":"","fax1":"","email":"[email protected]","www":"","bankaccount":"11111111111","password":"wpadmin","activation_status":"Y","bransje":"Velg en bransje...","butikknummer":null,"kommentar":null,"butikk_navn":"","butikk_addresse":"","butikk_poststed":"","butikk_telefon":"","butikk_postnummer":"0","butikk_beskrivelse":"","butikk_epost":"","butikk_faks":"","apningstider_hverdag":"","apningstider_helg":"","stengetider_hverdag":"","stengetider_helg":""}],"total_count":4,"version":1}}}

  9. #19
    Sencha User
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Your 'activ' values are still strings, so you will need to modify CheckColumn, so it handles "1" and "0" values instead of true and false.

  10. #20

    Default

    Quote Originally Posted by Condor View Post
    Your 'activ' values are still strings, so you will need to modify CheckColumn, so it handles "1" and "0" values instead of true and false.
    OK. How can I modify CheckColumn? What do I need to write? (Sorry, I am new to this)

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Can Ext.Ajax connect to GWT RPC method that returns JSON?
    By richardcatlin in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 29 Sep 2010, 3:31 PM
  2. Adding Checkbox Column to a grid
    By mannyk in forum Ext Designer: Help & Discussion
    Replies: 2
    Last Post: 23 Aug 2010, 10:00 PM
  3. Row editor grid Adding new row
    By mayurid in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 18 Jul 2010, 8:42 PM
  4. Adding a row to a grid
    By shajeerkt in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 17 Oct 2009, 12:44 AM
  5. Adding Id's to Row's in Grid
    By Vikram1507 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 17 Mar 2009, 6:20 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •