jQuery UI Widgets Forums Grid angular grid cell validation by callback

This topic contains 1 reply, has 2 voices, and was last updated by  Todor 4 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • jahangir

    I need to validate jqxGrid cell depending result from server. But validation message shows as ‘invalid value’ though still server not responded. How can i wait for callback from server for validation message?

    columns: any[] =
                    text: 'Code',  datafield: 'code',  width: 140,  
                    validation: (cell, value): any => {
                        if (value.length > 0) {
                            this.itemService.getItemByCode(value).subscribe(value1 => {
                                if(value) {
    								setTimeout(() => {
    									// some code
    									return true;
    								}, 1000);
    							} else {
    								return { result: false, message: 'Not found' };
                        } else {
                            return true;
                { text: 'unitLog',  datafield: 'unitLog', hidden: true,  cellbeginedit: this.cellbeginedit },
                { text: 'Note',  datafield: 'operatorComment', cellbeginedit: this.cellbeginedit},


    Hello jahangir,

    You just could not return value(for example true/false) directly in a subscription, because it is an async call. An async call means it is running in the background (actually scheduled for later execution) while your code continues to execute.

    You have to do all calculations with the server data in the service and then return true/false from the service.
    You could review the following example whether it fits your needs.

    Let us know if you need further assistance.

    Best Regards,

    jQWidgets Team

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.