Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
cellEdit Textarea newline enter will close cell
22/02/2011
17:12
Avatar
turigeza
New Member
Members
Forum Posts: 2
Member Since:
22/02/2011
sp_UserOfflineSmall Offline

Hi There,

Thank You for this great application by the way.

The problem is when you set cellEdit true and you have the cell set to textarea hitting enter will cause the data to be save instead of creating a new line. On a text area this is not the expected behavior. 

I have newest version of cqgrid and it happens on both firefox and chrome.

Geza

24/08/2011
00:43
Avatar
dinesh
Member
Members
Forum Posts: 5
Member Since:
16/08/2011
sp_UserOfflineSmall Offline

This problem still exist!

@turigeza: Did you find any solution?

Thanks! 

24/08/2011
01:35
Avatar
dinesh
Member
Members
Forum Posts: 5
Member Since:
16/08/2011
sp_UserOfflineSmall Offline

I'm temporarily using the solution posted here :

/blog/?page_id=393/bugs/jqgrid-3-8-1-celledit-enter-key-saves-cell-instead-of-adding-new-line-in-textarea-with-solution/

I'm using JQGrid 4.1.1. I had to REPLACE:

if (e.keyCode === 13) {$($t).jqGrid("saveCell",iRow,iCol);}//Enter

WITH

if (e.keyCode === 13 && (e.target.tagName === undefined || e.target.tagName != 'TEXTAREA')) {$($t).jqGrid("saveCell",iRow,iCol);}//Enter

Another common issue with the textarea is that on Save all the line breaks go away. Temp solutions from here:

http://www.trirand.net/forum/d.....#038;t=337

I had to REPLACE:

if($t.p.treeGrid && $(".tree-wrap",$(tcell)).length>0) {
                            $("span",$(tcell)).html(v).attr(title);
                        } else {
                                $(tcell).html(v).attr(title);
                        }

WITH

if($t.p.treeGrid && $(".tree-wrap",$(tcell)).length>0) {
                            $("span",$(tcell)).html(v).attr(title);
                        } else {
                            if ($t.p.colModel[pos].edittype && $t.p.colModel[pos].edittype=='textarea')
                                $(tcell).text(v).attr(title);
                            else
                                $(tcell).html(v).attr(title);
                        }

Hope this helps someone!

24/08/2011
03:53
Avatar
dinesh
Member
Members
Forum Posts: 5
Member Since:
16/08/2011
sp_UserOfflineSmall Offline

There is another problem with the TEXTAREA, that it loses it's linebreaks when entering the EDIT mode in cell edit. To prevent it a custom unformatter can be applied to the TEXTAREA column.

http://www.trirand.net/forum/d.....  post#6

my textarea column:

{name: 'Description', index: 'Description', width: 300, editable: true, search: false, sorttype: 'text', edittype: 'textarea', unformat: unfrmttextarea, editoptions: { rows: "10", cols: "40"} }

the unformatter func:

            function unfrmttextarea (cellvalue, options, cellobject) {
               return cellvalue;
            }

With all the total 3 (including my prev post) changes, the textarea field now looks promising  🙂

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
44 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information