inline edit autocomplete show undefined

Questionsinline edit autocomplete show undefined
Grayson asked 4 years ago

i want to add new item using inline add,
after click add button, inline autocomplete field show 'undefined'.
but if i insert using popup add, field is empty (not 'undefined')

i want inline autocomplete show empty field, so i can input right away without removing 'undefined' text first.
i can use $col2["editoptions"] = array("defaultValue"=>' '); to override the undefined text, but i cant assign either '' or null to default value, so i have to put white space to tricked it, but it still not an empty value.

here's my col code:

$col2 = array();
$col2["title"] = "Item Name"; // caption of column
$col2["name"] = "purchase_request_item_name"; // grid column name, must be exactly same as returned column-name from sql (tablefield or field-alias)
$col2["search"] = true;
$col2["width"] = "7";
$col2["show"] = array("list"=>true, "add"=>true, "edit"=>true, "view"=>true);
$col2["editable"] = true;
$col2["formatter"] = "autocomplete"; // autocomplete
$col2["formatoptions"] = array("sql"=>"SELECT
item b
b.item_id = a.item_original_id
) as item_hs_code,
(SELECT item.item_hs_code FROM item WHERE item_id=item_original_id)AS item_hs_code,
CONCAT('(',item_original_code,') ',item_original_name,' (',item_packing_detail_measurement,' ',item_packing_detail_uom,'/',item_packing_original,' )') as v FROM item_packing a
WHERE item_packing_record_status = 'A' AND item_packing_company_id = '$_SESSION[user_company_id]' AND item_packing_is_discontinue <> '1'",
"search_on"=>"CONCAT(item_original_code,' ',item_original_name)","callback"=>"fill_form_item", "update_field" => "purchase_request_item_name");
$col2["editrules"] = array("required"=>true);
$cols2[] = $col2;

1 Answers
Abu Ghufran answered 4 years ago

Add this JS code on page to fix this issue.

// fix for autocomplete shown as undefined while add
jQuery.fn.fmatter.autocomplete = function (cellval, opts) { return ''; }

Your Answer

13 + 5 =

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?