jQuery UI Widgets › Forums › Grid › jqxNotification instead of default cell validation message
Tagged: jqxGrid ;, Notification, validation
This topic contains 4 replies, has 2 voices, and was last updated by jgarcias 4 years, 2 months ago.
-
Author
-
I am having issues with the default cell validation messages, especially when validating the first column in my jqxGrid, the message is displayed at the bottom of the cell and to the left so it is not possible to read the whole message. It would be nice to center it or having a jqxnotification instead of that default message.
If relocating the default message is not possible, how about using a notification message? any example?Hello jgarcias,
The default validation message of the grid has
position: absolute
so you can relocate by changing thetop
andleft
styles properties of the elements with classesjqx-grid-validation-arrow-up
andjqx-grid-validation
.Otherwise, you could use the
cellendedit
event to perform custom validation with jqxNotification. You have both the old and the new value in the event arguments so you can undo the cell value and open the notification element, if needed.Best Regards,
MartinjQWidgets Team
https://www.jqwidgets.com/Hi Martin
Thank you for your answer.
I decided to go for the cellendedit event and perform my custom validation. Everything works as expected except for one small curious thing: the jqxNotification is showing twice. I have dug in my code to see if I wrote something wrong but I can’t find it.Here is my code for the validation:
{ text: gridHeaders[0], dataField: 'memberName', renderer: function (text, align) { return '<div class="gridHeader">' + text + '</div>'; }, cellendedit: function (row, datafield, columntype, oldvalue, newvalue) { if (newvalue == "") { $('#validationMsg').jqxNotification("open"); $('#grid_2').jqxGrid('selectcell', row, datafield); return false; } else { return true; } }, width: 213, }
Besides that function there is no other one calling or activating my jqxNotification object.
Any clue of why is this happening?
Hello jgarcias,
You are right, the
cellendedit
column callback is called twice.
Instead, you could use thecellendedit
event of the grid. Please, take a look at the following Example.Another option is to use a flag to know when to open the notification. You can see this Example.
Best Regards,
MartinjQWidgets Team
https://www.jqwidgets.com/Hi Martin
Beautiful !!
I went forcellendedit
event of the grid and that solved my issue.Many thanks!
-
AuthorPosts
You must be logged in to reply to this topic.