How do I change the time separator in a dropdown?

QuestionsHow do I change the time separator in a dropdown?
Simon Tavner asked 3 years ago

Hi,

I have a dropdown menu which is populated from a datetime database field, because the time element contains the : character the dropdown options are truncated. can you tell me how to change this so the dropdown shows the full date and time?

The full datetime displays correctly in the table field, please see the link screenshot below, also below is the code for this column.

View post on imgur.com

$col = array();
    $col[“title”] = “Start Time”;
    $col[“name”] = “timing_group”;
    $col[“width”] = “140”;
    $col[“editable”] = true;
    $col[“align”] = “center”;
    $col[“edittype”] = “select”;
    $str = $g->get_dropdown_values(“SELECT DISTINCT id AS k, start_time AS v FROM zd4k_timing_groups”);
    $col[“editoptions”] = array(“value”=>”:;”.$str);
    $col[“formatter”] = “select”;
    $col[“stype”] = “select”;
    $col[“searchoptions”] = array(“value”=>”:;”.$str);
    $cols[] = $col;

Thanks in advance,
Simon

3 Answers
Abu Ghufran Staff answered 3 years ago

It’s fixed in latest build which I’m emailing you. Thanks for reporting.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Simon answered 3 years ago

Hi Abu,

Thanks for the updated file, I’ve installed this (renaming the existing file and copying in the new version) bust still the fault persists

I’ve attached a new screenshot taken today, the file was updated last week.

View post on imgur.com

Thanks,

Abu Ghufran Staff answered 3 years ago

Hello,

I am unable to understand your question correctly. What you need is mentioned in documentation.

// In case you want to use different delimiter (:) and separator (;), you can override
$col[“editoptions”][“delimiter”] = “:”;
$col[“editoptions”][“separator”] = “;”;

Ref: https://www.gridphp.com/docs/column-options/#render-as-select-dropdown

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

19 + 10 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?