phproad / phpr-framework

[PHPR Framework] PHPRoad system files
http://phproad.com
MIT License
12 stars 2 forks source link

Multiple List and Controller Improvement #34

Open damanic opened 10 years ago

damanic commented 10 years ago

Multiple lists without forms could be simpler to use.

For example if you place multiple lists in the form preview and choose list_no_form = true so that you can have them all in the main form. There is no way to easily identify which list is requesting an update from the controller.

By default all ajax updates to the list should submit a post variable that includes the listname.

Eg. Add list_name to data{}

<a href="javascript:;" onclick="return $(this).phpr().post('<?=$this->get_event_handler('on_list_column_click') ?>', {
                    data: { column_name: '<?=$column->db_name ?>', list_name: '<?= $this->list_name ?>' },
                    update: '#<?=$this->list_get_container_id() ?>', 
                    customIndicator: LightLoadingIndicator, 
                    success: function(){ jQuery('#<?=$this->list_get_container_id() ?>').trigger('listUpdated'); }
                }).send();">

We can then easily check for listnames in the controller.

if (post('list_name') == 'my_other_list')
{
$this->list_model_class = 'xEducation_StudentAssignedCourseModule';
...
}
damanic commented 10 years ago

also

listReload() is output multiple times if default _list_container used more than once on a page.

Need one listReload function to handle all lists:

listReload(list_name, show_load_indicator){}

or functions made for each list

<?=$this->list_name?>Reload(show_load_indicator){}