Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Unable to select beyond 2nd level within form 14 Mar 2018 22:47 #15509

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Hello Admin

Can you resolve this please? Cook is unable to select fields beyond the second level within a form. However, it can resolve the same field selection if it is placed in a filter combo. I am trying to get the name of the user but only get fields from the first linked table.

Thanks
V

Please Log in or Create an account to join the conversation.

Unable to select beyond 2nd level within form 16 Mar 2018 04:24 #15512

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Hello Admin

Not having alot of time to play with, I was able to resolve this issue quickly by adding ORM functionality to the addSelect routine (see below). I don't know if you would consider looking at whats possible in the near future, but would love to see this limitation resolved so decided to share my 10min approach.

Best regards
v

USAGE:
\components\com_xxx\fork\views\users\view.html.php
	case 'assigned_to':
	/* Ajax List : Users
	 * Called from: view:job, layout:job
	 */
		$model = $this->getModel();
		$model->addSelect(array(
				'userid.name'
		));
		$items = $model->getItems();

MODIFIED ROUTINE:
\administrator\components\com_xxx\fork\classes\model\list.php
	/**
	* Method to store a SELECT entry for the SQL query.
	*
	* @access	public
	* @param	string	$select	
	*
	* @return	void
	*/
	public function addSelect($select)
	{
		if (!is_array($select))
			$this->addQuery('select', $select);

		if (is_array($select))
			$this->orm->select(array(
					$select
			));
	}

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.071 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started