⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Custom Message, Action



muonshirata
  • profile picture
  • Member

Posted 19 February 2012 - 10:13 AM

Hello All i use CI 2.1.0 and grocery crud 1.1.8
Here is my question.
Can I Make custom message? not error message. Like Infromation message after input or dropdown fields.
Can I add_action after add_button not each field. I will use this to reporting like pdf,excel for my entire data. [color=#0000ff]Edited [done][/color]
Can I change these word 'No items to display' to my string or my html? maybe i can set with set_lang_string perhaps.[color=#0000ff] Edited [done][/color]
Sorry if my word so short and to the point, because my english not good enough.
Thank You for your all good work.

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 19 February 2012 - 11:30 AM

As I seen the 2nd and the 3rd are already done .

So as for the 1st one you need something like : callback_after_add_field or something like that right? I'am afraid that I don't have this in grocery CRUD yet. The good news is that at the next version 1.2 it has a possibility to have this kind of thing. If not in version 1.2 for sure the 1.2.1 will include this functionality . For now the only way to do it is to have a callback_add_field and callback_edit_field. But if you still want to keep all the functionality of the automated fields , the only way is to do it now without changing the core library is with JavaScript.

muonshirata
  • profile picture
  • Member

Posted 19 February 2012 - 12:08 PM

Thank you web-johny
i get error when i using validation is_unique.

i check it in function is_unique line 4149 $field is null. only get parameter $str
Message: Undefined offset: 1
Filename: libraries/grocery_crud.php
Line Number: 4151

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 19 February 2012 - 18:53 PM

Hello there, I don't know why this is happening but even if it works it will not work properly as it will also checks if it is unique at the update.

A solution for this is to create a custom validation callback, you can find a guideline at: http://www.grocerycr...indpost__p__262 . The post is old and says about 3 changes that if you use grocery CRUD version 1.1.8 or later you will not have to do them. Hope it helps.

muonshirata
  • profile picture
  • Member

Posted 20 February 2012 - 13:10 PM

Thank you very much web-johny.

I've seen choosen.js which is used to select / dropdown in grocery crud.
I have a problem in large data and the length of a big character to display in this dropdown.
7000++ record.
example like : book's title.
'This book have a very long long long title' Is it okay to substring this title with callback or any great ideas?

first can i modify it to ajax? It will be nice and i think more lightweight.

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 20 February 2012 - 18:55 PM

Yes I know this kind of issue.I will try to have this feature at the next version. I am not promising anything yet. But I will do my best.
I also have a really helpful contribution of this code from davidedm so it will make it easier for me to add it.

muonshirata
  • profile picture
  • Member

Posted 25 February 2012 - 11:20 AM

[quote name='web-johnny' timestamp='1329764150' post='554']
Yes I know this kind of issue.I will try to have this feature at the next version. I am not promising anything yet. But I will do my best.
I also have a really helpful contribution of this code from davidedm so it will make it easier for me to add it.
[/quote]

Maybe this link will be usefull.
http://dev.meltingice.net/ajax-chosen/docs/ajax-chosen.html
https://github.com/meltingice/ajax-chosen

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 25 February 2012 - 11:25 AM

WOW that's great. I will have a look. Thanks

muonshirata
  • profile picture
  • Member

Posted 20 March 2012 - 07:09 AM

Another ajax chosen.
https://github.com/mobyle2/mobyle2.core/blob/master/src/mobyle2/core/static/js/ajax-chosen.js

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 20 March 2012 - 07:30 AM

Actually [member='muonshirata'] ajax-chosen is not a good idea. I totally did everything to make it work for version 1.2 and then I realized that it has many bugs. This didn't stop me as I also changed the Javascript as I liked the idea. But still needs lot of improvement and all the work I've done it was just a waste of time :( .
So I will go with the ui autocomplete idea, as it is at least for 100% stable.

muonshirata
  • profile picture
  • Member

Posted 20 March 2012 - 09:09 AM

okay sorry for wasting your time.
maybe next time i will give better idea.
thaks for your hard work.

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 20 March 2012 - 21:28 PM

It's not your fault. I was very happy when I discovered ajax-chosen and I like to try new projects. I don't have any problem with that and thank you for your idea.
it is just not ready for a production project.

DRKgatsby
  • profile picture
  • Member

Posted 05 April 2012 - 15:05 PM

Hello,
I have a question thats related to the add_action function. I was just wondering if there was a way to change what column the actions show up. They always seem to pop up in the last column, but is there a way to put them in the first column?