Yii Framework Forum: [EXTENSION] multimodelform/jqrelcopy - Yii Framework Forum

Jump to content

  • (15 Pages)
  • +
  • « First
  • 9
  • 10
  • 11
  • 12
  • 13
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] multimodelform/jqrelcopy Solutions for clientside cloning Rate Topic: ***** 4 Votes

#201 User is offline   Paul_Kish 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 25-October 12
  • Location:Nairobi,Kenya

Posted 21 November 2012 - 04:13 AM

very awesome extension, worked really well after reading the forum posts, keep posting guys very helpful, and to the author of the extension a very big thanks :D . Quick question, How can one access the IDs for the cloned form elements?
"Live without Regret"- Fire Fist Ace
@Paul_Kish
0

#202 User is offline   ragua 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 135
  • Joined: 23-January 12
  • Location:Paris - France

Posted 18 December 2012 - 08:48 AM

Hi,
i need dropdownlist for a boolean field (as checkbox doesn't work) in multimodelform, the field is correctly saved but when i open my form it always show the first value even if it's the second in database.

      $relStudentSemesterFormConfig = array(
      'elements'=>array(
...
        'ind_info_autoformation'=>array(
			'type'=>'dropdownlist',
			'items'=>array( 1 => 'Oui', 0 => 'Non'),
            'ajax'=>array(
            	'type'=>'POST',
				'dataType'=>'json', 
				'data'=>array('ind_info_autoformation'=>'js:this.value'), 
                'url'=>CController::createUrl('student/verifFinAutoformation'),
				'success' => 'function(data) 
				{
					$("'.$remarque.'").val(data.remarque);
        		}'
            ), 
...


Have you got an idea?
Thanks
0

#203 User is offline   Joblo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 685
  • Joined: 12-September 10
  • Location:Austria

Posted 18 December 2012 - 08:52 AM

A short adhoc answer:
A single checkbox doesn't work, but you can use a Checkboxlist with one item instead.

See Howto checkboxes
0

#204 User is offline   ragua 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 135
  • Joined: 23-January 12
  • Location:Paris - France

Posted 18 December 2012 - 09:16 AM

Thanks Joblo,
i tried checkboxlist but i have also problems with it, the choice is never selected for instance.

View PostJoblo, on 18 December 2012 - 08:52 AM, said:

A short adhoc answer:
A single checkbox doesn't work, but you can use a Checkboxlist with one item instead.

See Howto checkboxes

0

#205 User is offline   rashmani 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 26-August 11

Posted 04 January 2013 - 05:26 AM

Hi Joblo (and all),

yep, thanks, great extension.
I've been using it and it surely does the job. But in my new app, I have a related model with a composite Primary Key. Current MMF version wasn't working for me, so I've downloaded and tried the "Elix patch", that uses an older version of jquery-relcopy though (3.3 vs. 4.0).
With the patch, my compositePK-model is shown but: adding a new clone doesn't work, remove does but the element you just removed gets added again if you then add, if you save after removing an element CDbCommandBuilder raises an Exception for an undefined offset while checking columns' raw names.

So, my questions are:
- do you have an alternative/better solution for composite PK models, apart from redesigning tables to use a simple PK?
- (hopeless) do you have any experience with the above patch? Elix, are you reading this? Could you provide any additional experience regarding your patch?

TIA,
rash*
0

#206 User is offline   lilli 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 19-April 12

Posted 10 January 2013 - 11:58 AM

got the same problem for the composite primary key.
how can i manage it?
0

#207 User is offline   Zetsubo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 10-January 13

Posted 10 January 2013 - 07:01 PM

Hi.
First of all, thanks for this great extension.

There is a way to make an nested MultimodelForm?
0

#208 User is offline   luk1999 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 20-April 11
  • Location:Poland

Posted 18 January 2013 - 01:36 PM

Very nice extension.
Could you add support for Foundation 3 styles (like you did for Bootstrap)?
Could you also add option for change rendering class (default is MultiModelRenderForm) to configuration file? Now if i want to extend it i need to extend also MultiModelForm class and override some methods like renderTableBegin (or change extension code - bad idea...).
0

#209 User is offline   Joblo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 685
  • Joined: 12-September 10
  • Location:Austria

Posted 20 January 2013 - 01:25 PM

Released v.4.5

- added support for composite pk -> rashmani, lilli
- new property 'renderForm' allows a custom 'MultiModelRenderForm' -> luk1999
- changed update behavior: loads the record from the db by findByPK before update (like default behavior of actionUpdate in a controller)

For those who want help me: mmf on github

luk1999: sorry, have no time to look at foundation3.
But if you take a look at the bootstrap mmf-code, should be possible to support foundation too.
You can make a pull request on github, if you have added foundation support.

zetsubo: sorry, have no time to experiment with nested multimodelforms. please try yourself.
1

#210 User is offline   luk1999 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 20-April 11
  • Location:Poland

Posted 21 January 2013 - 06:05 AM

Thanks. Could you also add also ability to define custom MultiModelEmbeddedForm class?

Could you also add params for add button? Something like this:
class MultiModelForm {

    /**
     * The htmlOptions for the add link
     *
     * @var array $addHtmlOptions
     */
    public $addHtmlOptions = array();
}

class MultiModelRenderForm
{  
    
    /**
     * Get the add item link or button
     *
     * @return string
     */
    public function getAddLink()
    {
        if ($this->parentWidget->addItemAsButton)
        {
            echo CHtml::htmlButton(
                $this->parentWidget->addItemText,
                array_merge(
                    $this->parentWidget->addHtmlOptions,
                    array(
                        'id' => $this->parentWidget->id,
                        'rel' => '.' . $this->parentWidget->getCopyClass()
                    )
                )
            );
        } else
        {
            return CHtml::tag('a',
                array_merge(
                    $this->parentWidget->addHtmlOptions,
                    array(
                        'id' => $this->parentWidget->id,
                        'href' => '#',
                        'rel' => '.' . $this->parentWidget->getCopyClass()
                    )
                ),                
                $this->parentWidget->addItemText
            );
        }
    }  
}

With these modifications using your extension with Foundation should be pretty easy. I'll write how to do this later.
0

#211 User is offline   nakarin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 08-May 12

Posted 06 February 2013 - 02:37 AM

I try mmf.demo.4.5.zip ,when I added two members in the same group I got this error " Array to string conversion ".What am I missing? Any help please.OK I found the problem now.The problem is the wampserver.But now I want to know how to use bootstrap in form builder.Any idea?
0

#212 User is offline   Joblo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 685
  • Joined: 12-September 10
  • Location:Austria

Posted 08 February 2013 - 06:15 AM

You only have to set 'bootstrapLayout'=>true.
No need for special bootstrap in the formbuilder for the multimodelform.

See: bootstrap support

For other purposes: Yiibooster supports formbuilder.
0

#213 User is offline   Enrique Salazar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 29-January 13

Posted 08 February 2013 - 10:53 AM

Hi All

Great extension, I am very close to make it work 100% for me.

I have been struggling with the checkboxlist. I already made it work when adding a single record, but with multiple new records, it doesnt record the checkboxes as it should.

All the other fields save just fine, the checkbox is the only one giving me trouble.

Heres what I try to save.
Attached File  mmf_checkbox_before.png (6.54K)
Number of downloads: 36

Heres what it shows after saving
Attached File  mmf_checkbox_after.png (7.31K)
Number of downloads: 39

Any ideas?

Thank you very much.

Enrique.
0

#214 User is offline   Joblo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 685
  • Joined: 12-September 10
  • Location:Austria

Posted 08 February 2013 - 11:29 AM

Do you use the checkbox-list with one checkbox as explained here?
0

#215 User is offline   Enrique Salazar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 29-January 13

Posted 08 February 2013 - 11:34 AM

yup.

'ostenta_tenencia' => array(
                'type' => 'checkboxlist',
                'items' => array('1' => ' '),
            )


I put a blank space there, but I tried with a word there and same error.

Making further testing. The error is only when first creating additional rows. If I edit the checkboxes within the records already saved, everything works just fine.
0

#216 User is offline   Joblo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 685
  • Joined: 12-September 10
  • Location:Austria

Posted 08 February 2013 - 11:36 AM

And in demo code, if you change it to one checkbox?
I need something, where to reproduce this error.
0

#217 User is offline   Enrique Salazar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 29-January 13

Posted 08 February 2013 - 12:03 PM

View PostJoblo, on 08 February 2013 - 11:36 AM, said:

And in demo code, if you change it to one checkbox?
I need something, where to reproduce this error.


The demo worked fine with multiple checkboxes, after changing to one checkbox I get

 Array to string conversion 

0

#218 User is offline   Joblo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 685
  • Joined: 12-September 10
  • Location:Austria

Posted 09 February 2013 - 06:37 AM

I can't reproduce the error in the 4.5 demo and one single checkbox works fine too.
Maybe an issue with the PHP version or Linux/Win ??


Changed in demo:

$memberFormConfig = array(
  ...
 'flags'=>array(
              'type'=>'checkboxlist',
              'items'=>array('1'=>'Founder'),
              ),
   ...
)



Tested with 'tableView'=>true and false - all fine.

PHP version 5.3.6 on Windows 7 (XAMPP Installation).

nakarin had the 'Array to string conversion' on WAMPP too. What was the problem? How did he solve it?

In which php-file / line does the error happen?
0

#219 User is offline   nakarin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 08-May 12

Posted 10 February 2013 - 10:07 PM

View PostJoblo, on 09 February 2013 - 06:37 AM, said:

I can't reproduce the error in the 4.5 demo and one single checkbox works fine too.
Maybe an issue with the PHP version or Linux/Win ??


Changed in demo:

$memberFormConfig = array(
  ...
 'flags'=>array(
              'type'=>'checkboxlist',
              'items'=>array('1'=>'Founder'),
              ),
   ...
)



Tested with 'tableView'=>true and false - all fine.

PHP version 5.3.6 on Windows 7 (XAMPP Installation).

nakarin had the 'Array to string conversion' on WAMPP too. What was the problem? How did he solve it?

In which php-file / line does the error happen?


I think the problem is WAMPP wampserver2.2e-php5.4.3-httpd2.2.22-mysql5.5.24-32bit/Windows 7 ,so I changed to xampp-win32-1.7.4-VC6-installer/Windows 7 and the problem 's gone.Thanks for your great extension,Cheers.
0

#220 User is offline   Kochiro 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 16-September 10
  • Location:Göteborg, Sweden

Posted 12 February 2013 - 08:19 AM

Has anyone been able to integrate this extension with TinyMCE so that textarea fields are output as wysiwyg editors?

Thanks
0

Share this topic:


  • (15 Pages)
  • +
  • « First
  • 9
  • 10
  • 11
  • 12
  • 13
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users