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.058 seconds
I have been using Cook for only a day now and it is the next best thing to Jagermeister. It is very easy to use and I see some of the greatest Joomla Components ever! coming from Cook users.
Naude (Forum)

Get Started