Last active
April 15, 2016 20:41
-
-
Save mindspank/bd5000811405298c018c to your computer and use it in GitHub Desktop.
qsocks 2.2 and listen for change events #engineapi #qsocks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var qsocks = require('qsocks'); | |
// ConnectOpenApp requires a appname property. | |
// Returns an array of [globalhandle, apphandle] | |
var connection = qsocks.ConnectOpenApp({ | |
host: 'localhost', | |
isSecure: true, | |
rejectUnauthorized: false, | |
appname: '7c876a9a-d62d-49ea-b21c-aaccda76c067', | |
debug: true | |
}); | |
connection.then(function(q) { | |
q[1].createSessionObject({ | |
qInfo: { | |
qId: '', | |
qType: 'list' | |
}, | |
qListObjectDef: { | |
qDef: { | |
qFieldDefs: ['[Case Owner]'] | |
}, | |
qInitialDataFetch: [{ | |
qWidth: 1, | |
qHeight: 1000, | |
qLeft: 0, | |
qTop: 0 | |
}] | |
} | |
}) | |
.then(function(model) { | |
model.getLayout().then(function(layout) { | |
console.log(layout) | |
}); | |
model.on('change', function() { | |
model.getLayout().then(function(layout) { | |
console.log(layout) | |
}) | |
}); | |
}); | |
q[1].getField('[Case Owner Group]').then(function(field) { | |
field.on('change', function() { | |
console.log('Field change') | |
}); | |
field.select('Systems').then(console.log, console.log); | |
}); | |
}) | |
.catch(function(err) { | |
console.log('err', err) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment