atk4

Form with head and detail

余生长醉 提交于 2019-12-12 03:13:52
问题 some time ago I've asked for something similar, but now I'm picking up with this, so asking again. Maybe this question can sound simple but it's not for me. I have two tables: header (id,date,field1,field2) // This has One entry on the table detail (id,idheader,field1,field2) // This can have multiple entries on the table so header (1) ---> detail (N) Which can be the best method to make a form and upate on the same $f->update() these two tables ? Imagine that this can be a lot of things: an

Extended CRUD, function formSubmit don't get all form elements?

血红的双手。 提交于 2019-12-12 02:42:50
问题 i have a problem, i cannot get values (added with $form->addField) from form in CRUD. I just get what's in the model, but there just isn't extra values... MODEL: class Model_Admin extends Model_Table { public $table ='admin'; function init(){ parent::init(); $this->addField('name')->mandatory('Name required'); $this->addField('email')->mandatory('Email required'); $this->addField('password')->type('password')->mandatory('Password required'); } } On page i create extended CRUD and add two more

Is there a CMS (WYSIWYG) Component for Agile Toolkit?

笑着哭i 提交于 2019-12-12 01:33:40
问题 I haven't seen the code in the standard distribution of Agile Toolkit. Does anyone have a add-on code which integrates Agile Toolkit form with some WYSIWYG editor? 回答1: any jQuery based editor would fit best. last one we played around with was ELRTE and it was very easy to get it up and running. 回答2: With this we can add a field richtext maybe?! Don't forget the all mighty TinyMCE and FCKEditor 回答3: Ok, I have got this code from other developer: $url=$this->api->locateURL('js','wymeditor

How to Set a Filter on a Field Referencing a Model in ATK4

青春壹個敷衍的年華 提交于 2019-12-12 00:44:00
问题 i am currently doing a complex multi-level classification system. to simplify, i will explain what i am trying to accomplish by providing theoretical examples: i have a group table: group id| group name 1 | A 2 | B 3 | C and i have a sub group table: subgroup id| group id| sub-group name 1 | 1 | A-aaaa 2 | 1 | A-bbbb 3 | 1 | A-cccc 4 | 2 | B-111111 5 | 2 | B-222222 6 | 3 | C-ONE 7 | 3 | C-TWO and i have a model that uses these two tables as references: class Model_ItemGrouping extends Model

how to use atk4 filestore file upload

爷,独闯天下 提交于 2019-12-11 15:06:02
问题 I'm having an issue using the atk4 filestore file upload. I copied the fileadmin.php from the atk4-addons into my page directory and created the tables using a the filestore_001.sql script which created four tables. I've added the following data to the filestore_type table and the following to the filestore_volume table I created a directory called upload in the webroot and tried with different permissions including 777 as a test to see if it was a permissions issue. After selecting the local

ATK4 - addTotals() results in 0.00 for totals

三世轮回 提交于 2019-12-11 14:07:33
问题 I am working with ATK4.2.1 and trying to get the addTotals() functionality to work on my Grid. I have tried setting the data to the grid with both the setModel and setSource methods. My grid shows up correctly with all data showing and with what appears to be the addTotals() row, but the results are always 0.00 on any fields I try setting as the 'money' type. Method #1- class page_showStats extends Page { function init(){ parent::init(); $grid=$this->add('Grid'); $grid->setModel('aggrStats');

Junction Table with mutiple primary keys

☆樱花仙子☆ 提交于 2019-12-11 14:03:34
问题 I started to learn Atk just a week ago and I decided to reimplement the business intranet which is becoming unmaintainable. The model abstraction is very cool to use but I wonder how to specify multiple primary keys for my junction tables. For example, I have sites and I want to assign machines on them for a period. Junction table This is very important to me to not touch the database. 回答1: I guess you can do that using joins in your Models if you're not allowed to add simple auto_incremented

ATK4 How to set up custom formatters?

末鹿安然 提交于 2019-12-11 11:32:17
问题 I'm trying to pretty-up a dropdown field, and I'm not sure I'm taking the right approach. I have this model for which the field 'type' is to be a dropdown that displays a string, but stores an integer. To format the output, I've subclassed Grid as class Model_Member extends MVCTable { function init() { parent::init(); $this->addField('type') ->type('list') ->display(array('grid'=>'mbrtype')) ->caption('Member Type') ->listData(array('Guest','Associate','Full')) ; } } To format the output, I

How to use file upload in agile toolkit 4.2

情到浓时终转凉″ 提交于 2019-12-11 11:09:28
问题 Is there somewhere a full example of working atk4.2 filestore example code? I've been searching in docs and stackoverflow and the few examples I have found just aren't working for me. Do I need to extend Model_File or Model_Filestore_File ? First gives me error Class is not defined in file Second one gives Unable to include filestore/lib/Model/Filestore/File.php What would be the simplest way to add file upload to CRUD? 回答1: If you want to have file upload, use the following in your model:

Agile toolkit : how to automatically reload grid

Deadly 提交于 2019-12-11 03:48:52
问题 Using Agile toolkit to generate a grid, I'm trying to get an automatic reload of a grid but I can't figure how :/ I dug into the js() function and saw the first parameter is $when but, how to set up an interval? Reload on event like button click is ok, but I need to set up reload every x sec. 回答1: OK here is complete tested example how you should do. First I have to admit, that ATK4 had no setInterval and clearInterval functions added in univ() library, but already had setTimeout. I added