×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Item Ordering
Alex Connor
New Member
Posts: 6
10 года 5 мес. назад #88
от Alex Connor
Alex Connor создал тему: Item Ordering
Hi!
Does anybody know how I can enable a site owner to rearrange the order of their items in their custom component? The only way I can do this right now is for the client to contact me, and I edit the IDs in the table. Any help would be appreciated!
Many thanks
Alex
Does anybody know how I can enable a site owner to rearrange the order of their items in their custom component? The only way I can do this right now is for the client to contact me, and I edit the IDs in the table. Any help would be appreciated!
Many thanks
Alex
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Søren Beck Jensen
Administrator
Posts: 81
10 года 5 мес. назад #94
от Søren Beck Jensen
Søren Beck Jensen
Founder, Component-Creator.com
Søren Beck Jensen ответил в теме Item Ordering
Any table that is generated by the Joomla Component Creator will have a row called ordering that will allow you to do this sorting. The trick is that you need to sort the list by ordering before you can see the sorting options. So imply click on the "ordering" header of you list to sort the list by ordering. You can then drag and drop the list order.
Hope this helps!
Hope this helps!
Søren Beck Jensen
Founder, Component-Creator.com
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Alex Connor
New Member
Posts: 6
10 года 5 мес. назад #107
от Alex Connor
Alex Connor ответил в теме Item Ordering
Hi Soren,
Thanks for your reply and advice!
However, I am already aware of how to arrange component items in the backend of the site, including the drag and drop method. Unfortunately, this doesn't appear to have any affect of the front end - the items remain unchanged!
Any further advice on what I might be missing would be very much appreciated.
Cheers,
Alex
Thanks for your reply and advice!
However, I am already aware of how to arrange component items in the backend of the site, including the drag and drop method. Unfortunately, this doesn't appear to have any affect of the front end - the items remain unchanged!
Any further advice on what I might be missing would be very much appreciated.
Cheers,
Alex
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Søren Beck Jensen
Administrator
Posts: 81
10 года 4 мес. назад #108
от Søren Beck Jensen
Søren Beck Jensen
Founder, Component-Creator.com
Søren Beck Jensen ответил в теме Item Ordering
You will need to change the front end model to load by ordering by editing the model file.
I will try to investigate if this should not be the default behavior, it sounds to me like it should.
I will try to investigate if this should not be the default behavior, it sounds to me like it should.
Søren Beck Jensen
Founder, Component-Creator.com
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Søren Beck Jensen
Administrator
Posts: 81
10 года 4 мес. назад #109
от Søren Beck Jensen
Søren Beck Jensen
Founder, Component-Creator.com
Søren Beck Jensen ответил в теме Item Ordering
Alex, we had a look and we more or less considered this a bug, so we have already implemented a fix. We don't like bugs
So simply re-build and re-install your component, re-order the list from the admin and the changes will appear in the front end.
Have a great day and thanks for reporting the issue.
So simply re-build and re-install your component, re-order the list from the admin and the changes will appear in the front end.
Have a great day and thanks for reporting the issue.
Søren Beck Jensen
Founder, Component-Creator.com
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Alex Connor
New Member
Posts: 6
9 года 10 мес. назад #568
от Alex Connor
Alex Connor ответил в теме Item Ordering
Hi Soren,
I found this post after all this time as I am again no longer able to arrange the order of my table's records using the previously mentioned drag and drop method.
I have created a new component. At first, when installing, my new page was completely blank. I turned on developer mode in global config, and saw this error:
I'm not great with php, but after a bit of trial and error I found that I could change this to:
and the page would display correctly. I should mention that I don't have a full understanding of this change.
However, as mentioned I am once again no longer to rearrange the records using drag and drop.
I don't know what to do from here - could you please help me find a solution to this?
Joomla version 3.3.6
PHP version 5.3.28
Hope you can help!
Many thanks
I found this post after all this time as I am again no longer able to arrange the order of my table's records using the previously mentioned drag and drop method.
I have created a new component. At first, when installing, my new page was completely blank. I turned on developer mode in global config, and saw this error:
Fatal error: Can't use method return value in write context in "path"/components/com_sails/models/saddiamemebrs.php on line 142
if (!empty($app->input->get('filter_order')))
{
$list = $app->getUserState($this->context . '.list');
$list['ordering'] = $app->input->get('filter_order');
$app->setUserState($this->context . '.list', $list);
}
if (!empty($app->input->get('filter_order_Dir')))
{
$list = $app->getUserState($this->context . '.list');
$list['direction'] = $app->input->get('filter_order_Dir');
$app->setUserState($this->context . '.list', $list);
}
I'm not great with php, but after a bit of trial and error I found that I could change this to:
if (trim($app->input->get('filter_order')) == false)
{
$list = $app->getUserState($this->context . '.list');
$list['ordering'] = $app->input->get('filter_order');
$app->setUserState($this->context . '.list', $list);
}
if (trim($app->input->get('filter_order_Dir')) == false)
{
$list = $app->getUserState($this->context . '.list');
$list['direction'] = $app->input->get('filter_order_Dir');
$app->setUserState($this->context . '.list', $list);
}
and the page would display correctly. I should mention that I don't have a full understanding of this change.
However, as mentioned I am once again no longer to rearrange the records using drag and drop.
I don't know what to do from here - could you please help me find a solution to this?
Joomla version 3.3.6
PHP version 5.3.28
Hope you can help!
Many thanks
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Время создания страницы: 0.058 секунд