Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to process binding
Message
From
02/07/2014 08:01:14
 
 
To
All
General information
Forum:
Javascript
Category:
Coding, syntax & commands
Title:
Unable to process binding
Miscellaneous
Thread ID:
01603075
Message ID:
01603075
Views:
65
Hi,

first attempt at digging into some slightly complex javascript. I am getting this error:
Uncaught ReferenceError: Unable to process binding "value: function (){return RunSheetDetailFilter.searchText }"
Not getting much hits when searching on this.

Basically it sounds as if the function has not been defined correctly.

This is the code in my cshtml file:
<input class="filter-box"
           data-bind="value: RunSheetDetailFilter.searchText, valueUpdate: 'afterkeydown', escape: clearFilter"
           placeholder="Filter by AWB#" type="text" />
This is my filter.runsheetdetail.js file (I am following an example that uses require.js):
define('filter.runsheetdetails',
    ['ko', 'utils', 'config'],
    function (ko, utils, config) {

    	var RunSheetDetailFilter = function () {
    		var self = this;
    		self.searchText = ko.observable().extend({ throttle: config.throttle });
    		return self;
    	};

    	RunSheetDetailFilter.prototype = function () {
    		var tagDelimiter = '|',
                escapedTagDelimiter = '\\|',
                searchTest = function (searchText, runsheetdetail) {
                	if (!searchText) return true; // always succeeds if no search text
                	var srch = utils.regExEscape(searchText.toLowerCase());
                	if (runsheetdetail.awb_number().toLowerCase().search(srch) !== -1) return true;
                	return false;
                },

                predicate = function (self, runsheetdetail) {
                	// Return true if all of these meet the filter criteria. Otherwise, return false
                	var match = searchTest(self.searchText(), runsheetdetail);
                	return match;

                	//PAPA: testing only. 
                	//var matchSearch = searchTest(self.searchText(), session),
                	//    matchFav = favoriteTest(self.favoriteOnly(), session),
                	//    matchTime = timeSlotTest(self.minDate(), self.maxDate(), session),
                	//    matchModels = modelTest(self.timeslot(), self.speaker(), self.track(), session);
                	//console.log('search filter matched: ' + matchSearch);
                	//console.log('favorites filter matched: ' + matchFav);
                	//console.log('time filter matched: ' + matchTime);
                	//console.log('models filter matched: ' + matchModels);
                	//console.log('MATCH === ' + matchSearch && matchFav && matchTime && matchModels);
                	//return matchSearch && matchFav && matchTime && matchModels;
                };

    		return {
    			predicate: predicate
    		};
    	}();

    	return RunSheetDetailFilter;
    });
Can anyone spot anything wrong in there?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Next
Reply
Map
View

Click here to load this message in the networking platform