Topic: Editable Item Description's Input is TextBox. How to Enable TextArea

The following function returns a TextBox to Edit Item Description if Item is Editable. Some Item Descriptions needs to be multi lines. How can this function returns TextArea for Editable Items.

function sales_items_list_cells($label, $name, $selected_id=null, $all_option=false, $submit_on_change=false, $editkey=false)
{
    if ($editkey)
        set_editor('item', $name, $editkey);

    if ($label != null)
        echo "<td>$label</td>\n";
    echo sales_items_list($name, $selected_id, $all_option, $submit_on_change,
        '', array('cells'=>true));
}
www.boxygen.pk

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

this should be a great feature, resizable textarea instead of textbox. I think this post should move to Wish List...

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

Open ui_list.inc  and goto line number 259 around and find the below code.

."<input type='text' $disabled name='{$name}_text' id='{$name}_text' size='".
                $opts['editable']."' maxlength='".$opts['max']."' $rel value='$edit'>\n";

and replace with below one.

."<textarea $disabled name='{$name}_text' id='{$name}_text' cols='35' rows='5"    .($name ? " title='$name'" : '')    .">$edit</textarea>\n";

this is code helps you to change it multi-line input(TextArea).  But it wont save them like multi lines. There are few other files needs to be edited to allow it to process multi line inputs

Subscription service based on FA
HRM CRM POS batch Themes

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

@joe: a nice functionality but may affect a lot more tables fields / scripts.

5 (edited by boxygen 07/13/2018 07:07:52 am)

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

I have tested the recommended code of @kvvaradha. It is working fine and data is correctly displayed even in reports. The only problem mentioned in this screen short

The TextArea is encompassing the second column

Post's attachments

Sales_Mod_Overlap.png 161.7 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.
www.boxygen.pk

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

I have set the cols='35' and rows='3' and now its OK for me

www.boxygen.pk

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

A screenshot using the standard default theme (and not the dashboard/canvas) theme would be better for design purposes.

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

@boxygen ,  I gave it as simple and stand to replace the textbox with textarea.  But it requires to save the multi lines as like it inputted.  For that, we need to change some more to take effect. Also it may possible to add a option to change it either textbox or textarea

Subscription service based on FA
HRM CRM POS batch Themes

9 (edited by poncho1234 07/13/2018 02:34:45 pm)

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

I like this too
Notes:-

  1. Editable desc is stored in sales_order_details & debtor_trans_details which are both tinytext so 255 char max

  2. @apmuthu it should only affect combo_input fields which are editable.

  3. When selecting an editable desc item in purchases the textarea is only visible after selecting quantity or price - Is anyone else getting this?

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

I can see this commit by @joe for Item Editable Description. I have applied this but I couldn't find any change in Behaviour of Editable Item Description. Any Idea how shall I expect the change?

www.boxygen.pk

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

Try clearing the js and other browser cache and try it.

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

@boxygen -  The commit code was adjusted by myself. it was discussed here. I hope you understand, when you check this thread.

Subscription service based on FA
HRM CRM POS batch Themes

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

@kvvaradha, thanks got it.

www.boxygen.pk

14 (edited by cristiart 10/31/2019 05:22:02 am)

Re: Editable Item Description's Input is TextBox. How to Enable TextArea

boxygen wrote:

I can see this commit by @joe for Item Editable Description. I have applied this but I couldn't find any change in Behaviour of Editable Item Description. Any Idea how shall I expect the change?


to view in pages and PDF add -nl2br- in -> sales\includes\ui\sales_order_ui.inc -> around line 183

label_cell($stock_item->item_description);

to

label_cell(nl2br($stock_item->item_description) );



you also want to replace in sales\includes\ui\sales_order_ui.inc around line 492

text_cells(null,'item_description', null, 45, 150);

to

textarea_cells(null, 'item_description', null, '45' , 5,  $title = null);