× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Show ID in form table view not working as expected
#1
Hi,

I've been trying to show ID in a new form table view but it doesn't seem to be working. The header ID is shown, but the content is missing. The reason being I wanted to create a link in order to update a table entry and couldn't find a way to get the row ID. Maybe there's a set of functions I missed?

Anyway, the bug seems to be where the table is reordered before being displayed, in that the ID value is held in the form itself, but the ID field is not part of the form_form, so doesn't get merged.

Fixed this by adding the ID field to the order array like so:


Code:
foreach($t as $r){
    
    if($opts['id'] == 1){ $order = array('id'=>'ID') + $order; }. // added this line to fix, code continues below
             
    // All of this is to get the table in the same order as your form
    $r = array_intersect_key($r,$order);                 
    $r = array_merge($order,$r);


I'm trying to display a form with an edit link so the entries can be updated, couldn't find an easier way to do it Smile
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)