raelkun00's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
Active Members
Active Posts:
98 (0.09 per day)
Joined:
01-October 12
Profile Views:
1,792
Last Active:
User is offline May 19 2015 03:54 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   raelkun00 has not set their status

Posts I've Made

  1. In Topic: Cakephp Report Manager

    Posted 28 Apr 2015

    Hi,
    I can now see the It's index, but when I try to select model, It's just creating another divs.
    Posted Image
    I just added routes, so I can access.
    Router::connect('/report_manager/reports/*', array('controller'=>'reports', 'plugin'=>'report_manager'));
    
  2. In Topic: CSS Border-Left Gradient

    Posted 27 Apr 2015

    Hi,
    I am using google chrome.
  3. In Topic: Cakephp : Import Controller Inside AppController

    Posted 26 Apr 2015

    Hi Sir,
    My problem is solved. I just import model of other controller so I cant use It's function.
    Thanks
  4. In Topic: CakePhp ajax success but not executing action

    Posted 15 Apr 2015

    Hi, my problem is solved. Thanks guys. This is my code in case someone needs it.
    $('.username').on('save', function(e, params) { 
                    $('div.bhoechie-tab-menu>div.list-group>a').each(function(){
                        var tabindex=$(this).index();
                        var docentry="";
                        var table = document.getElementById('details'+tabindex);
                        for (var r = 1, n = table.rows.length; r < n; r++) {
                          docentry=document.getElementById('details'+tabindex).rows[r].cells[9].innerHTML;
                          docentryID=document.getElementById('details'+tabindex).rows[r].cells[6].childNodes[0].id;
                           if (e.target.name===docentry){
                                if (e.target.id===docentryID){
                                   var newVal="";
                                   var scannedField = document.getElementById('scanned'+e.target.id);
                                   var increment=0;
                                   var lines = params.newValue.split('\n');
                                   var barcodevalue="";
                                   for(var i = 0;i < lines.length;i++){
                                       if (lines[i]!==""){
                                            $.ajax({
                                            data:{barcode:lines[i]},
                                            url: '/NGP/salelines/getqty',
                                            cache: false,
                                            type: 'POST',
                                            success: function (data) {
                                                if($(data).filter('#barcodeqty').html()>0){
                                                    alert('executed3');
                                                    increment=increment+parseFloat($(data).filter('#barcodeqty').html());
                                                }
                                            },
                                            error:function(jqXHR, textStatus, errorThrown){
                                                    alert(errorThrown);
                                            }
                                            });
                                                newVal=newVal.concat(lines[i].replace(',',''));
                                                newVal=newVal.concat(',\n');
                                                alert('executed1');
                                           }
                                   }
                                   alert('executed2');
                                   params.newValue=newVal.substring(0,newVal.length-2);
                                   document.getElementById('details'+tabindex).rows[r].cells[7].childNodes[0].childNodes[1].value=increment;
                               }
                            }
                        }
                   });
                });
    
  5. In Topic: CakePhp ajax success but not executing action

    Posted 14 Apr 2015

    View PostArtificialSoldier, on 14 April 2015 - 09:25 AM, said:

    Quote

    On my other ajax that is working I am using url "/salelines/checkso" but on x editable It can't found that url so I have to add the project name "/NGP/salelines/getqty" maybe that's the problem?

    I'm not quite sure what you're saying, but if you want to add arbitrary data to an element then you can use a custom data attribute to store things that you can look up later.


    Hi,
    This is my working ajax, As you can see my url is 'sales/checkso' I don't have to include NGP in my url
    $.ajax({
                        data:{checkeddocentry:document.getElementById(e.target.id).nextElementSibling.innerHTML},
                        url: 'sales/checkso',
                        cache: false,
                        type: 'POST',
                        success: function (data) {
                            if ($(data).filter('#checkso').html()==="true"){
                                $('#salesmodal').modal({
                                show: true,
                                height:50,
                                width:50
                                });
                                document.getElementById(e.target.id).checked=false;
                                
                            }
                        },
                        error:function(jqXHR, textStatus, errorThrown){
                                alert(errorThrown);
                        }
                        });
    

    This is the ajax that is not working,As you can see with this url it's not executing my action so I have to change this url to '/NGP/salelines/getqty' my action is being executed but I can't receive any data on my action
        public function getqty(){
            //$this->autoLayout=false;
            
             if($this->request->is('ajax')){
                  $test=$this->request->data;
                  $this->log('BARCODE'.$test);
                 $query=$this->getFieldValue('[@MPRODPLU]','U_PL_CONVQTY' , 'U_PL_PLUCODE', $this->Session->read('BRANCH'), $barcode);             
                 if(empty($query)){
                      $exist=false;
                      echo "<div id='barcodeqty'>".$query."</div>"; 
                  }else{
                      $exist=true;
                      echo "<div id='barcodeqty'>".$query."</div>";
                  }
             }
        }
    

    $('.username').editable({
            url: 'salelines/getqty',
            dataType: 'html', //assuming json response
            type:'POST',
            cache:false,
            data:{barcodename:'test'},
    //        ajaxOptions: {
    //            dataType: 'json'
    //        },           
           success: function(data, config) {
               if(data && data.id) {  //record created, response like {"id": 2}
               } else if(data && data.errors){ 
                   //server-side validation error, response like {"errors": {"username": "username already exist"} }
                   config.error.call(this, data.errors);
               }               
           },
           error: function(errors) {
               alert(errors);
               var msg = '';
               if(errors && errors.responseText) { //ajax error, errors = xhr object
                   msg = errors.responseText;
               } else { //validation error (client-side or server-side)
                   $.each(errors, function(k, v) { msg += k+": "+v+"<br>"; });
               } 
               alert(msg);
           }
        });
    

    Thanks

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

raelkun00 hasn't added any friends yet.

Comments

raelkun00 has no profile comments yet. Why not say hello?