Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About tsatsar

  • Rank
  1. *Can't edit previous post* I understand the url, it's my return on my else. Now I'm trying this : $feuille_de_jour_responsable = new FeuilleDeJourResponsable(); if (Yii::$app->request->isAjax) { Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; $data = Yii::$app->request->post(); return $data; } else { // return ['success' => false]; return $this->render('create', [ 'feuille_de_jour_responsable' => $feuille_de_jour_responsable, ]); } And the alert(data); on my function
  2. Without set a datatype, it says "success here" but nothing is save. I test, it work with datatype to "text" but the same. I don't understand because in firebug, I have url "GET index.php?r=feuille-de-jour-responsable/create&Date_Calendai‌​re=2016-11-10&ID_Pos‌​te_FDJ=1&ID_Categori‌​e=1&Code_Personnel=4‌​901" but with the "$feuille_de_jour_responsable->load(Yii::$app->request->post‌​())" It will be saved, isn't it ?
  3. Sorry, I change this because I need to progress on this project... Now I'm on this : http://larryullman.com/forums/index.php?/topic/18975-ajax-on-yii2-for-fullcalendar/ where you help me already
  4. I understand. But I don't understand why and how to do what I want
  5. Sorry for double post, I don't have the permission for edit. With this : error: function(xhr, status, error) { alert(error); } I have : href="http://www.hostingpics.net/viewer.php?id=831486wfvc.png
  6. Whit the function I put previously, I got just "Exception", It just did'nt work I try with this function : error: function(xhr, status, error) { alert(xhr.responseText); } And I get just my code ... http://www.hostingpics.net/viewer.php?id=952703fds.png
  7. I began to use firebug (I didn't know it, it's wonderfull ! ). And I progress a little bit : My view JS-Ajax : <div class="row"> <div class="col-md-4"> <?= $form->field($feuille_de_jour_responsable, 'ID_Categorie')->dropDownList(CategorieFdj::find()->select(['Nom', 'ID_Categorie'])->indexBy('ID_Categorie')->column(), ['id'=>'catId']); ?> </div> <div class="col-md-4"> <?= $form->field($feuille_de_jour_responsable, 'ID_Poste_FDJ')->dropDownList(PosteFdj::find()->select(['Nom_Poste_FDJ',
  8. There are no error and just nothing happens, so I thing it's maybe the Url... But I don't undertand
  9. Hello, I'm using Fullcalendar for Yii2 (https://github.com/philippfrenzel/yii2fullcalendar-demo) and I want to save with Ajax the event when I click on a date. The datas commes from the dropdownlist. It seems that my code couldn't find the function in my controller, maybe it's the Url ? My view with JS and the link to my funstion Ajax on my controller : <?php $form = ActiveForm::begin(); ?> <div class="row"> <div class="col-md-4"> <?= $form->field($feuille_de_jour_responsable, 'ID_Categorie')->dropDownList(CategorieF
  10. Thank you for your answer. I didn't find a solution so I'm passed to other way.
  11. *Sorry again, can't edit* I think I'm progressing. I'm using Pjax : My form : <?php Pjax::begin(); ?> <?php $form = ActiveForm::begin(); echo FormGrid::widget([ 'model'=>$feuille_de_jour_responsable, 'form'=>$form, 'autoGenerateColumns'=>true, 'rows'=>[ [ 'attributes'=>[ 'ID_Categorie'=>['type'=>Form::INPUT_DROPDOWN_LIST, 'items'=>CategorieFdj::find()->selec
  12. Sorry again for double post but I can't edit. I try something else : <?php $form = ActiveForm::begin(['feuille-de-jour-responsable/create']); echo FormGrid::widget([ 'model'=>$feuille_de_jour_responsable, 'form'=>$form, 'autoGenerateColumns'=>true, 'rows'=>[ [ 'attributes'=>[ 'ID_Categorie'=>['type'=>Form::INPUT_DROPDOWN_LIST, 'items'=>CategorieFdj::find()->select(['Nom', 'ID_Categorie'])->indexBy('ID_Categorie')->column(),'id'=>'cat-id','hint'=>'Choisir
  13. *Sorry for multiple post, I can't edit* I try again with the function create from yii (I don't know why, I try before post :/ ) My funcion create : public function actionCreate() { $feuille_de_jour_responsable = new FeuilleDeJourResponsable(); if ($feuille_de_jour_responsable->load(Yii::$app->request->post()) && $feuille_de_jour_responsable->save()) { return $this->redirect(['view', 'Date_Calendaire' => $feuille_de_jour_responsable->Date_Calendaire, 'ID_Poste_FDJ' => $feuille_de_jour_responsable->ID_Poste_FDJ, 'ID_Catego
  14. I forgot to say : when I click on submit, the page reroll but nothing more...
  • Create New...