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
empty cell content before edit
19/11/2009
19:10
Avatar
vctw
New Member
Members
Forum Posts: 2
Member Since:
20/11/2009
sp_UserOfflineSmall Offline

Hi, all

I tried to empty cell content before edit it, here is my code

                    formatCell: function(rowid, cellname, value, iRow, iCol) {
                                        $('#mygrid').setCell(rowid,cellname,null,null,null);
                                    },

I also tried beforeEditCell event, both event triggered. But the cell still has old value while editing, not a empty cell I expect.

How can I get a empty cell while editing, so I don't have to delete old value first?

Thanks,

20/11/2009
03:45
Avatar
dinoboy
Estonia
New Member
Members
Forum Posts: 2
Member Since:
20/11/2009
sp_UserOfflineSmall Offline

I used editRow method to edit my rows and in oneditfunc I reset the input value like this:

function editRow(rowId) {
  $('#mygrid').editRow(rowId, true, function() {
    var input = $('#' + rowId + '_yourColumnName');
    input.val(null);
  });
}

You can also access the original value if needed, like this:

var originalValue = input.parent().attr('title');

Because cells values are also stored in the <td> title attribute.

If you want this behavior to be applied to all columns, you can iterate over all the visible columns or just ask all inputs from the given <tr> by using jQuery.

20/11/2009
12:19
Avatar
vctw
New Member
Members
Forum Posts: 2
Member Since:
20/11/2009
sp_UserOfflineSmall Offline

Thanks for your tip. It's strange that won't work for me. I am using 3.5.3. After google around, I found something work for me. Post here in case somebody also need this.

                    afterEditCell : function(rowid, cellname, value, iRow, iCol) {
                                        $("#sales tr[id='"+rowid+"'] td:eq("+iCol+") input").val("");
                                     },

BTW: cell property like this editable:true,edittype:'text'

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
53 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