Is it possible to drag drop Picklist element items between records on a list?

Bren

Member
Hello all.
I've been playing around with the Picklist element on a form. It's pretty cool.
Is it possible to drag & drop Picklist element items between records on a Fabrik list?
Thanks in advance.
 
Hello all.
I'm revisiting this thread because what I'm needing to do is similar to what I asked previously here. I'm needing to have 2 lists on 1 page and the ability for a privileged user to be able to drag a record from 1 list to another list. Only 1 text element needs to be displayed on the 1st list (an employee name) and be drag and dropped onto the 2nd list. The 2nd list really needs to be a list of drop pick lists with each drop list beside a text element (describing a project in the 2nd list). This drag & drop action would automatically save the changes to the DB. If anyone can do this please let me know because I would be willing to pay a small fee for it.
Thanks in advance.
 
When you say "2 lists on one page", do you mean 2 picklists in a form, or literally 2 Fabrik lists?

Assuming you mean picklists, would the two have identical options?

-- hugh
 
Hi Hugh.
Yes, literally 2 Fabrik lists on 1 page. Ya, the picklists in each list can have identical options.
Any suggestions, Hugh?
Thanks in advance.
 
not quite sure if I got what you want to do.
Maybe you can create a search form (not recording to DB, just for selecting data), add a picklist with the stuff you need (use Advanced/Eval populate) and then a php form plugin to save the data to DB where you need it.
 
Hi Hugh.
Yes, literally 2 Fabrik lists on 1 page. Ya, the picklists in each list can have identical options.
Any suggestions, Hugh?
Thanks in advance.

It would be a LOT of work, certainly not a "small fee".

-- hugh
 
Hi guys.
Attached is a couple snippets of what I'm trying to do. I put this together in an article and added a Fabrik list via the Fabrik content plugin.
The first attachment has some javascript for dragging employee names to the scheduled green area. I'd like each record (in the list below) to have it's own green area that a user can drag an employee to and then it would be be saved to the related record. Any suggestions?
Thanks in advance.
 

Attachments

  • Drag Drop Example.JPG
    Drag Drop Example.JPG
    73.3 KB · Views: 241
  • Drag Drop Example2.JPG
    Drag Drop Example2.JPG
    69.4 KB · Views: 241
You could use the user_ajax method we provide, see ./components/com_fabrik/user_ajax_example.php. Fire off an AJAX call after the drag&drop, and manually update the tables accordingly.

-- hugh
 
Hello All.
I'm still working on the drag and drop between lists. I made some good progress this weekend with getting the employee items to drag & drop into the list into a Fabrik display element. I'm stuck on something that I though should be relatively simple. Attached is a snippet / screenshot of what my job list looks like (typical Fabrik list look). I'd like this list to look more like the 2nd attachment; where the Scheduled Employees element (grey droppable area) is listed below the Job # & Site Name Elements. I imagine this format change is needed in a Fabrik custom list template; but I'm not sure what to adjust to make this look happen. Any suggestions?
Thanks in advance.
 

Attachments

  • Drag Drop Example - 5-16-16.JPG
    Drag Drop Example - 5-16-16.JPG
    80.7 KB · Views: 244
  • Desired List Format.JPG
    Desired List Format.JPG
    46 KB · Views: 230
Hello All.
I've made more progress with the drag and drop between lists. I have the drop saving the data to the DB via ajax. Attached is a pic of what it looks like.
When the page is refreshed the display element in the jobs list has some PHP code in the default setting to display what's saved. The problem is only 1 of the records saved is being displayed after refresh.
Here is the code I have in the default setting of the display element.
Code:
include 'cli/resources_scheduled.php';
foreach ($arraylistScheduled as $arrayrow) {
  if ($arrayrow['fid_project']=={bw_projects___id}) {
    $fid_employee = $arrayrow['fid_employee'];
    $resourcename = $arrayrow['name'];
    return '<li id="'.$fid_employee.'" class="ui-state-default" style="list-style-type:none;padding: 5px 10px;cursor: pointer;border-radius: 5px;margin: 10px 10px 0 0;background: #3267fe;color:#ffffff;display: inline-block;-webkit-box-shadow: 0 10px 6px -6px #777;-moz-box-shadow: 0 10px 6px -6px #777;box-shadow: 0 10px 6px -6px #777;">'.$resourcename.'</li>';
  }
}
Not sure why only 1 record is displayed. Any suggestions?
Thanks in advance.
 

Attachments

  • Drag Drop Example - 5-27-16.JPG
    Drag Drop Example - 5-27-16.JPG
    108.6 KB · Views: 221
Hi Hugh.
Ya, I should of included it. Below is the code from within the "cli/resources_scheduled.php" file.
Code:
<?php
define( '_JEXEC', 1 ); //This will define the _JEXEC constant that will allow you to access the rest of the Joomla framework
$joomlaPath = dirname(__FILE__)."/.."; //The only part you have to change. Make sure the relative part points to your Joomla root
define('JPATH_BASE', $joomlaPath);
require_once( JPATH_BASE.'/includes/defines.php' );
require_once( JPATH_BASE.'/includes/framework.php' );
// Instantiate the application.
$app = JFactory::getApplication('site');
// Initialise the application.
$app->initialise();
// Now you can use all classes of Joomla

// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);

$query->select('fid_employee');
$query->select('name');
$query->select('fid_project');
$query->select('scheduled_date');
$query->from($db->quoteName('bw_scheduledlabordates'));
$query->where($db->quoteName('scheduled_date').' = CURDATE()');

// Reset the query using our newly populated query object.
$db->setQuery($query);

$arraylistScheduled = $db->loadAssocList('scheduled_date');
//print_r($arraylistScheduled);   //Uncomment this row for testing purposes
?>
Any suggestions? Thanks in advance.
 
I don't see anything obviously wrong, but I don't know how many rows will match your where clause.

Have you tried var_dump()'ing the query ...

Code:
var_dump((string) $query);exit;

... and run it by hand, see what it yields?

-- hugh
 
Thanks for the suggestion, Hugh. I tried adding the following to my included php file. I'm not, yet, sure what to do with this info. Not sure if I should have included something in the (string) portion to make things clearer?
Code:
var_dump($query);exit;
Anyway, I tried commenting out the WHERE portion of my query and the results was interesting. It appears other employees are displayed in separate jobs; but not if they are on the same scheduled date & never more than 1 employee per job. See the attached snippets / screenshots of the table data and the page results after refresh.
Any suggestions? Thanks in advance.
 

Attachments

  • table data.JPG
    table data.JPG
    68.2 KB · Views: 223
  • Drag Drop Example - 5-31-16.JPG
    Drag Drop Example - 5-31-16.JPG
    177 KB · Views: 223
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top