SmartClient Version: v10.0p_2015-10-21/Enterprise Development Only (built 2015-10-21)
Firefox, Chrome on Mac OSX
please modify the #customBinaryField sample like this:
I've just added a canEdit:false to the ListGridField named 'file'
then evaluate listGrid.startEditingNew(), you'll get this error:
the error is thrown at line 58305 of modules-debug/ISC_Forms.js:
Firefox, Chrome on Mac OSX
please modify the #customBinaryField sample like this:
Code:
isc.DynamicForm.create({
ID: "formView",
width: "100%",
dataSource: customBinaryField,
fields: [
{name: "id", width: 150, canEdit:false},
{name: "file", canEdit:false}
]
});
isc.DynamicForm.create({
ID: "formEdit",
width: 100,
dataSource: customBinaryField,
fields: [
{name: "id", width: 150, required: true},
{name: "file", required: true}
]
});
isc.IButton.create({
ID: "uploadButton",
title: "Upload",
width: 100,
click: function(){
formEdit.saveData("if(dsResponse.status>=0) formEdit.editNewRecord()");
}
});
isc.VLayout.create({
ID: "vLayoutForms",
width: 100,
members: [
isc.Label.create({
contents: "Editor",
width: 50,
height: 25,
autoDraw: true,
baseStyle: "exampleSeparator"
}),
formEdit,
uploadButton,
isc.Label.create({
contents: "View",
width: 50,
height: 25,
autoDraw: true,
baseStyle: "exampleSeparator"
}),
formView
]
});
isc.ListGrid.create({
ID: "listGrid",
width:500, height:224, alternateRecordStyles:true,
dataSource: customBinaryField,
selectionType: "single",
autoFetchData: true,
fields:[
{name:"id", width:100},
{name:"file", width:380, canEdit:false}
],
recordClick: function(viewer, record, recordNum, field, fieldNum, value, rawValue) {
formEdit.editSelectedData(listGrid);
formView.editSelectedData(listGrid);
}
});
isc.HLayout.create({
ID: "hLayoutTop",
width: 700,
layoutMargin:10,
membersMargin: 10,
members:[listGrid, vLayoutForms]
});
isc.Button.create({
ID: "buttonDownload",
width:200,
title: "Download Selected File",
click: function () {
var selectedRecord = listGrid.getSelectedRecord();
if (selectedRecord == null) {
isc.say("You must select one record");
return;
}
customBinaryField.downloadFile(selectedRecord);
}
});
isc.Button.create({
ID: "buttonView",
width:200,
title: "View Selected File",
click: function () {
var selectedRecord = listGrid.getSelectedRecord();
if (selectedRecord == null) {
isc.say("You must select one record");
return;
}
customBinaryField.viewFile(selectedRecord);
}
});
isc.HLayout.create({
ID: "hLayoutButtons",
width: 500,
layoutMargin: 10,
membersMargin: 10,
members: [buttonDownload, buttonView]
});
isc.VLayout.create({
ID: "vLayout",
width: 300,
members: [hLayoutTop, hLayoutButtons]
});
then evaluate listGrid.startEditingNew(), you'll get this error:
Code:
11:04:35.413:TMR7:WARN:Log:TypeError: this.editForm is undefined
Stack from error.stack:
FileItem.redraw()
FormItem.setWidth()
[a]MathFunction.invokeSuper()
[a]MathFunction.Super()
CanvasItem.setWidth()
[a]MathFunction.invokeSuper()
[a]MathFunction.Super()
FileItem.setWidth()
[c]Class.setProperties()
ListGrid.makeEditForm()
ListGrid.showInlineEditor()
ListGrid._startEditing()
ListGrid.startEditing()
ListGrid.startEditingNew()
unnamed()
[c]Class.evaluate()
[c]Class.evalWithVars()
[c]Log.evaluate()
[c]Class.evaluate()
DebugTarget.evalJSWithDevConsoleVars()
.call()
.handlePacket()
.start/this.socket<.packetReceived()
.receive()
[c]Class.fireCallback()
Timer._fireTimeout()
Timer.setTimeout/_6<()
Code:
var item = this.editForm.getItem(0);
Comment