This extension allows you to create editable elements on your page.
It comes instead of previous yii-bootstrap-editable that was upgraded to
X-editable library.
Major changes are:
It contains 4 widgets:
and 2 components:
Please visit extension homepage: x-editable.demopage.ru
Requirements depend on core library you want to use:
If you have any questions or ideas feel free to ask in comments or open issue on github page.
[enh #7] column sort icons for bootstrap (vitalets)
[bug #41] if all columns have apply=false grid becomes un-editable after update (horizons2)
[enh #39] support php < 5.3 (vitalets)
[enh #37] added Editable::source method (vitalets)
[enh #38] CSRF support out of box (horizons2)
[enh #35] support of dates as timestamp (andersonamuller)
[enh] support of virtual_fields in EditableColumn (vitalets)
[enh #33] allow apply as a PHP expression in EditableColumn (oinegue)
[enh #22] allow CArrayDataProvider for EditableColumn (ciarand)
[enh] added bootstrap datetime support (vitalets)
[enh #5] source as array is always data, not Yii route (vitalets)
[enh #9] support for namespaced models (vitalets)
[enh] updated to x-editable 1.4.4: added combodate and select2 (vitalets)
[enh #16] EditableDetailView defaults + french translation (mdeweerd)
[bug] If apply = true, attribute can be unsafe (vitalets)
[enh] Added composer support (vitalets)
[chg] EditableDetailView emptytext no more taken from nullDisplay option (vitalets)
[bug] Disable loading Yii's css for EditableDetailView in bootstrap mode (vitalets)
[enh #6] Added support of composite primary keys (vitalets)
[enh] Added Italian messages (vitalets)
Initial release.
Total 20 comments
Hi thank you for your fast reply i use this on my profile/view.php:
on my UsereController.php
on my User.php
i set on my embedded document Profile.php
to use this modules i also edit your file EditableSaver.php here
and here
@Edgar Kuskov,
evaluating
applyis seems to be already done.have a look on:
https://github.com/vitalets/x-editable-yii/blob/master/EditableColumn.php#L95
For invalid date - could you show the full snippet?
@cico
could you show the code how you create widget for
user.profile.name?vitaliy
Hi, i'm try to use this great extension with mongoDBsuite and it work fine!
but i have a problem with embedded document in a "root" model, i can't edit the fields of embedded document. I try to explain with my real case:
My model is User.php and my embedded document is Profile.php. If I use edidableField widget and i try to edit a filed of embedded document for example $user->profile->name the field is not editabled.
I hope it is clear.
Thank you
Hello guys,
i would like to give a tip for the "apply" value in EditableClass, just change the line 65:
if($widget->apply)) { to if(!eval('return '.$widget->apply.';')) {
and now you are able to parse some really awesome conditions like: .... 'apply'=>'($data->manualPrice && strtotime($data->toDate)>strtotime(date("Y-m-d")))', ....
Thanks for the great extension!
P.S: There is a bug by date field, when i pass there a date like 2013-06-19 the field is always showing the todays date, i think there will be good to give the valueFormat.
Works like a charm. Thanks again!
@deez
please have a look on updated demo of 1.2.0, there is example of sorting by related model.
Thanks vitalets. Great extension by the way.
hi deez,
your post bring me to some investigation of sources. I made several changes and will release 1.1.1 within a few days.
Thanks!
Can anyone tell me how to filter and sort on a related model? For example:
In the compare statement in the Model I would normally create a pseudo element and call that in the grid, and the sort and the compare.
How do I do it with this method?
In case it helps anyone that needs to replace the user input with the actual saved value from the model.
In the controller:
And in the view:
hi,
For view please see samples.
For controller, if you are not updating model and just perform search, you just create action and use data from $_POST.
Hi, Great extension! I have a grid, and I have a search form for this grid. I would like to replace this search form with elements from this extension. Can you please have an example of what would be in the view and the controller? Thanks in advance! Zvi.
Thanks @haymps!
I included the bootstrap files manually, i.e.
bootstrap.js,bootstrap.cssandbootstrap-responsive.css.I didn't add any extension nor did I change any configuration. I thought this implied that I added bootstrap manually.
Is it possible to make
x-editablework under these conditions?Cheers
Have you downloaded bootstrap into your extensions folder?
Then add this in config/main.php
-all the best.
Hello,
I'm not using the Yii-bootstrap extension but included bootstrap manually. However, I get an exception when I try to use the
EditableFieldwidget reporting that no bootstrap component exists.How can I use x-editable, having included the bootstrap files manually?
Thank you!
Thanks for the extension. I was about to make a similar (lighter) one for DetailViews and I discovered this extension which already did pretty much what I needed.
I made some improvements so that it is easier to set default options for the 'EditableField' which is called by the 'EditableDetailView' (especially 'success') along with some other improvements/corrections.
All options of 'EditableField' are now available as options of 'EditableDetailView'. And I added the French translation.
I made a Pull Request with my changes.
Hi Vitalets,
When I looked at the X-editable, it is already in version 1.4.1. While X-editable-yii v1.0 is still using X-editable 1.3.0. If, I just change the js and css files, Is it possible to do so? The feature that I really waiting for is Select2.
Could not wait for you to release new X-editable-yii.
Thanks,
Daniel
Hi,
I have two models, Product and ProductPrice.
Product
id name unit
ProductPrice
id productFk FK to product(id) description minQty price
I have TBGridView of Product that also shows the Price for each product based on its min quantity of purchase. TBGridView is like this
| No | Name | Unit | Price Min Qty = 1| Price Min Qty = 3 | Price Min Qty = 6
Price Min Qty is defined on model ProductPrice while the TbGridView is using model Product (the $model is Product). I set editable for all Price Min Qty, how could I acomplish this task?
Cheers,
Daniel
yes, EditableColumn can only set single type for whole column.
But it's interesting, what is your final task?
maybe EditableDetailView would be suitable?
I'm trying to do two things: Currently the type field applies to the entire column. The column is text or the column is data picker, etc. In thinking about it, I could pass in an array that has the type for each row of the column.
The other item is to add a color picker to one of the types. I will loog tat github link provided by Vitalets. Thanks!
Leave a comment
Please login to leave your comment.