title: yii : how to pass the data via ajax from cjuidialogbox?
body: <p>Q : how to pass the data via ajax from cjuidialogbox?</p>
  
  <p>Status : I created a popup box by cjuidialogbox. When the user select a customer name from the cgridview of popup box, pass the customer code to function via ajax. Stacking is here
  url: \'' . Yii::app()->createUrl("job/getjobno", array("c_code" => $data->c_code)) . '\',
  help me to pass the data.</p>
  
  <p>This is cjuidialog box</p>
  
  <pre><code>&lt;?php 
  $this-&gt;beginWidget('zii.widgets.jui.CJuiDialog',array(
                  'id'=&gt;'customerlist',
                  'options'=&gt;array(
                      'title'=&gt;Yii::t('job','Customer List'),
                      'autoOpen'=&gt;true,
                      'modal'=&gt;'true',
                      'width'=&gt;'750',
                      'height'=&gt;'500',
                  ),
                  ));
  echo $this-&gt;renderPartial('_listing', array('model'=&gt;$model)); ?&gt;
  &lt;?php $this-&gt;endWidget('zii.widgets.jui.CJuiDialog');?&gt;
  </code></pre>
  
  <p>This is _listing.php</p>
  
  <pre><code>&lt;?php $this-&gt;widget('zii.widgets.grid.CGridView', array(
      'id'=&gt;'customer-grid',
      'dataProvider'=&gt;$model-&gt;search(),
      'filter'=&gt;$model,
      'columns'=&gt;array(
          'customer_name',
          array(
              'class'=&gt;'CButtonColumn',
              'template'=&gt;'{select}',
              'buttons'=&gt;array
              (
                  'select' =&gt; array
                  (
                      'imageUrl'=&gt;Yii::app()-&gt;request-&gt;baseUrl.'/protected/assets/images/gridview/icon_select.gif',
                      'options'=&gt;array('style'=&gt;'width:10px; border:none'),
                      'click'=&gt;'function(){
                          var itemID = $(this).parents(\'tr\').find(\'.customer-id\').text();
                          //alert(itemID);
                          $.ajax({
                              url: \'' . Yii::app()-&gt;createUrl("job/getjobno", array("c_code" =&gt; $data-&gt;c_code)) . '\',
                              dataType: \'json\',
                              success: function(data){
                                  var target = $(vNode).parents(\'tr\');
                                  $("#Job_name").val(itemID); 
                                  //console.log(\'target tr: \' + target);
                                  //$(target).find(\'.item-price\').val(data.item_price);
  
                              }
                          });                     
                          $("#customerlist").dialog("close");
  
                      }',
                  ),      
              ),
          ),
          array(
              'type'=&gt;'raw',
              'value'=&gt;'$data-&gt;c_code',
              //'filter'=&gt;array('style'=&gt;'visible:none'), 
              'headerHtmlOptions'=&gt;array('style'=&gt;'width:0px; display:none; border:none; textdecoration:none'),
              'htmlOptions'=&gt;array('style'=&gt;'display:none; border:none;', 'class'=&gt;'customer-id'),  
              'header'=&gt;false,
              'filter'=&gt;false,
          ),
      ),
  )); ?&gt;
  </code></pre>