We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17422
    • 225 Posts
    the example was a simplification of what I had,
    I’ll get the default value via a snippet that I refer all.

    i use the same snippet for other TV with dropdown list menu and work fine.

    @EVAL return $modx->runSnippet(’salleConcertSnippet_France’, array(’pays’ => ’France’));


    my table have a lot row, + 900


    the result of my snippet in page :

    Rock’n Poche (74)==56||Théâtre Antique (38)==57||Paleo Festival (26)==58||Privé (84)==61||Rex (75)==62

      • 17883
      • 1,039 Posts
      Interesting. I copied your option values in my option values and it works fine. But while developing I also had a problem with such a runSnippet-call as option values. Perhaps there is some other problem. Do you also have the problem when inserting the result of the snippet as option values? I don`t think that this is related to accents, brackets or generally char-related.
        • 17422
        • 225 Posts
        i try with 40 value and the script stop at 5 row

          • 17883
          • 1,039 Posts
          i try with 40 value and the script stop at 5 row

          I don`t understand this. You mean you have 40 options and only 5 are shown? What if you copy

          Rock'n Poche (74)==56||Théâtre Antique (38)==57||Paleo Festival (26)==58||Privé (84)==61||Rex (75)==62


          in your options?
            • 17422
            • 225 Posts
            i multiplied the option value for testing.

            but my snippet return a lot of posibility

            see in attachment, the result of my snippet,

            i don’t try with select resources, tomorrow smiley
              • 17422
              • 225 Posts
              in checkboxSortable.php, i test the value with $modx->log(modX::LOG_LEVEL_ERROR
              for understand the code

              have this response in log :

              [2010-12-16 02:19:49] (ERROR @ /manager/index.php) i=> 220
              [2010-12-16 02:19:49] (ERROR @ /manager/index.php) tableau option=> 0_5_5_1


              with this code :


              $inputoptions = array();
              $i=0;
              foreach ($index_list as $inputoption){
              $inputopt_array = (is_array($inputoption)) ? $inputoption : explode("==",$inputoption);
              $option['value'] = isset($inputopt_array[1])?$inputopt_array[1]:$inputopt_array[0];
              $option['text'] = htmlspecialchars($inputopt_array[0],ENT_COMPAT,'UTF-8');
              $option['checked']=false;
              $inputoptions[$option['value']] = $option;
              $i++;
              }
              $modx->log(modX::LOG_LEVEL_ERROR, "i=> {$i} ");
              
              $options = array();
              $j=0;
              if (!empty($value[0]) && count($value)>0){
              foreach ($value as $itemvalue){
              $option=$inputoptions[$itemvalue];
              $option['checked']=true;
              $options[] = $option;
              unset($inputoptions[$itemvalue]);
              $j++;
              }
              }
              $options = count($options)>0?array_merge($options,$inputoptions):$inputoptions;
              
              $desde=$j."_".count($inputoptions)."_".count($options)."_".count($value);
              $modx->log(modX::LOG_LEVEL_ERROR, "tableau option=> {$desde} ");
              


                • 17883
                • 1,039 Posts
                I can request a pull if you want MadeMyDay.

                I just implemented Bruno`s fix and pushed it. You can make a pull request anytime... I am quite new to this Git stuff, but hey, somehow we all have to learn ;-)
                  • 17422
                  • 225 Posts
                  i have modify this foreach ;

                  foreach ($index_list as $inputoption){
                  $inputopt_array = (is_array($inputoption)) ? $inputoption : explode("==",$inputoption);
                  $option['value'] = isset($inputopt_array[1])?$inputopt_array[1]:$inputopt_array[0];
                  $option['text'] = htmlspecialchars($inputopt_array[0],ENT_COMPAT,'UTF-8');
                  $option['checked']=false;
                  $inputoptions[]= $option;
                  }



                  before :
                  $inputoptions[$option[’value’]]= $option;

                  after
                  $inputoptions[]= $option;


                  all columns are displayed

                  other question :

                  when modify a checkedbox, i want a save button change, disable => enable ?

                  who to do this with EXTjs and where i think is the listenner but how ? smiley





                    • 17422
                    • 225 Posts
                    i think for enable the button save when i change a checkbox or Drop a row

                    use this :

                    ,listeners: {
                                        'change': {fn:function(D) {
                                        MODx.fireResourceFormChange();
                                        this.fireEvent('change',D);
                                        },scope:this}
                    


                    but i don’t know where to put this part of code.

                    Thanks for your help.

                    Laurent
                      • 11076
                      • 159 Posts
                      Gave it a try and it’s awesome, very handy. thank you again.

                      In the screencast you’re using @EVAL to run getResources or some sort of @SELECT?
                      i’m still trying to figure out what is the best way to implant and use it, so more specific usage example would be great and much much appreciated. smiley

                      Laurent,
                      i’m experiencing the same behavior from the Save button, i think it is because the lack of a trigger, don’t have a clue of how to trigger it.
                        Michael Shraibman( gOmp)  | Freelance Design & Development | wink  impossible is nothing...