Enabling/Disabling decoders via JavaScript.

Hello,

I want to Enable/Disable certain decoders on the scanner using JavaScript. On the help file there is not clear the type of value this field accepts.

Thanks in advance.

Alex.

Darryn Campbell
Hi Alex,To enable or disable

Hi Alex,

To enable or disable specific decoders with JavaScript in RhoElements, you need to set the field of the scanner javascript module to either 'enabled' or 'disabled'. Please note that these values are strings.

Some examples:

function enableWebcode()

{

     scanner.webcode = 'enabled';

}

function disableCode128()

{

     scanner.code128 = 'disabled';

}

function setupForMarketScanning()

{

     //Disable some postal decoders

     scanner.ukPostal = 'disabled';

     scanner.japPostal = 'disabled';

     scanner.ausPostal = 'disabled';

     //enable some common decoders

     scanner.code128 = 'enabled';

     scanner.code11 = 'enabled';

     scanner.upca = 'enabled';

     scanner.code39 = 'enabled';

     //change some decoder settings

     scanner.code39FullAscii = 'true';

     scanner.code128maxLength = '20';

     scanner.code128minLength = '4';   

}

The scanner object will pre-exist on the web page.

Thanks for the alert about the lack of JavaScript decoder examples, I have added a task to add these to all of the decoder entries in the help file.

Regards,


Ben

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Darryn Campbell
Ben,Thanks a lot for the

Ben,

Thanks a lot for the quick (and correct) response.

Regards,

Alex.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments