jQWidgets Forums

Forum Replies Created

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

  • jittopjose
    Participant

    I manged to make it work in a different way. It may not be an optimized way. but it works. the code is as follows:

    self.productSource = function (query, response) {
    	    var dataAdapter = new $.jqx.dataAdapter
    	    (
    	        {
    	            localdata: getAllProductsAutoCompleteData(query, response),
                    datatype: "array"
    	        },
    	        {
    	            autoBind: true,
    	            formatData: function (data) {
    	                data.name_startsWith = query;
    	                return data;
    	            }
    	        }
    	    );
        };
    
        function getAllProductsAutoCompleteData(query, response){
        	_productModel.getAllProductsAutoComplete(query, function(data){
    	            	if (data.length > 0) {
    	                    response($.map(data, function (item) {
    	                        return {
    	                            label: item.ProductName,
    	                            value: item.ProductName
    	                        }
    	                    }));
    	                }
    	            });
        	return [];
        }

    now the asynchronous method call works and auto complete values are coming properly to the jqxInput

    Thanks,
    Jitto P.Jose


    jittopjose
    Participant

    Thanks for the replay.
    In fact the method I am calling is not a remote method. so cannot give URL. its a local method to access web sql in node-webkit. the database access in asynchronous. so the result come only in call back.. is it possible to give local method name for url field?

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