1. #1
    Sencha User
    Join Date
    Dec 2012
    Vote Rating
    ssenlighta is on a distinguished road


    Default Unanswered: A problem of specifying two or more methods of a PHP class on a server from a store

    Unanswered: A problem of specifying two or more methods of a PHP class on a server from a store

    Hi friends,
    Could anyone help me what can I here:
    1. I have one store specifies proxy(type=ajax) and its url (both (server) controller and its method(function))
    2. And through this url I am specifying (PHP) controller method which loads data from database to display in the grid
    3. Now I have a form that should insert(not working) some related data (in grid) into database
    4. I have got my code snippets like this:
    This code from the client controller->
     addAssignment: function(button){        if(this.getForm().getForm().isValid()){
            var win = button.up('window'),
            form = win.down('form');
            var values = form.getValues();
            //here we are in need of the a model instance of the current one
           // grid.store.insert(0, values);
            this.getUserlogStore().insert(0, values);
    This code from the store:
     proxy: {      type: 'ajax',
         url: Server.getUrl('Module.network.userlog','trafficLog'),
          reader: {
          type: 'json',
          root: 'trafficlog',
              exception: Server.createReaderExceptionCallback()
        //here we have to specify writer for for record writing
          writer: {
                type: 'json',
                //find what root does 
                // url: Server.getUrl('Module.network.userlog','addUserTrafficLog'),
                root: 'logupdate',
                listeners: {
                    exception: Server.createFormFailureCallback()
    This code from the server controller->
        class UserlogController extends ModuleApp{
            public function actionTrafficLog (){
                //this command variable stores values using dbCommand of the parent controller by this  
                $command = $this->dbCommand();//here you ing see that we using moduleApp as a  base controller 
                ))->from('user_traffic_log ut')
                  ->where('is_deleted = false');
                  $this->applySort($command, 'id DESC');
                  $trafficlog = $command->queryAll();
                  //this result method of the Controller specifies data send to the client 
            //from here on we should we would like to craete an action that serves as method for retrieving data from database 
            //for traffic log info 
            public function actionAddUserTrafficLog(){
                $json = file_get_contents('php://input');
                $data = CJSON::decode($json);
                //$data = $_POST;
                $command = $this->dbCommand();
                //keep inmind that calling a insert function of the dbCommand, we should specify table name as a first parameter 
                // and as a second paramter colums or array values 
                $result = $command->insert('user_traffic_log', array(
               // $logupdate = $command->queryAll();
    Thank you in advance

  2. #2
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Vote Rating
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice



    Two easy ways:

    Easiest with what you have: Use the proxy's api config to specify the endpoints that should be used for CRUD operations.

    Less easy, but more elegant (IMO): Use the Rest proxy. It will auto generate endpoints and HTTP verbs based on the particular CRUD action.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi