Does ASP.NET MVC Spreadsheet control in 3rd party tool syncfusion support cross sheet reference? I've been trying to look if cross sheet reference is being supported but could not find any.
Yes. Syncfusion have provided the support for the cross sheet reference in ASP.NET MVC Spreadsheet. Please refer the following Spreadsheet sample to demonstrate the cross sheet reference in formulas.
JS Playground
Code Snippet :
<div id="Spreadsheet"></div>
<script type="text/javascript">
var productData = [
{ Product: "Product1", Quantity: 10, Price: 10 },
{ Product: "Product2", Quantity: 12, Price: 20 }];
$(function () {
$("#Spreadsheet").ejSpreadsheet({
//...
sheetCount: 2,
sheets: [
{ rangeSettings: [{ dataSource: productData, startCell: "A1", showHeader: true }] },
],
loadComplete: "loadComplete"
});
});
function loadComplete(args) {
if(!this.isImport){
this.gotoPage(2, false); //Make Sheet2 as active sheet.
this.XLEdit.updateValue("A1", "=Sheet1!A1"); // Here "=Sheet1!A1" is Sheet1=>"A1" cell value reference and the value of A1 cell in Sheet1 is updated in Sheet2 "A1" cell.
//...
this.XLEdit.updateValue("B2", "=PRODUCT(Sheet1!B2,Sheet1!C2)");
//...
}
}
</script>
Also, please refer the online MVC Spreadsheet hyperlink Sample. In that, we have used the cross sheet reference for the hyperlinks which is placed under the StockDetail column.
Related
I need to simulate a drag & drop on fullcalendar in the week view with protractor. I found something with coordinates but I'd like a "no browser window dependent solution"... ther's also no way out on finding the exact starting cell in the week view by class or id ...or at least, I couldn't figure how to select a single cell of a row of a day because, using the Chrome's item selector, it seems every row has the same class fc-widget-content and cells are not "selectable" elements.
Are there any other chances?
maybe this is a little bit helpful (also very later ;). I also want to test my app with FullCalendar, but I'm using Cypress (similar to Protractor).
We plan items from an external list and assign it to a resource on a certain day/time in the FullCalendar (we use the scheduler plugin).
I found out that the drag and drop event is somehow intercepted by code, enriching it with for example properties of the event (like date, title and others). How I enriched this data is in the Cypress trigger('drop', data) command. Data is the evenData that is set by the Draggable class:
// Executed on the external list items, where every item we want to plan has class `.fc-event`.
this.draggableContainer = new Draggable(this.containerEl.nativeElement, {
itemSelector: '.fc-event',
eventData(eventEl) {
const id = eventEl.dataset.id;
return {
duration,
id: currentWorkItem.id,
title: currentWorkItem.description,
extendedProps: {
duration,
customRender: true,
data: currentWorkItem,
},
};
}
Then, in your test file (Cypress)
const eventData = {
date: new Date(),
dateStr: new Date().toISOString(),
draggedEl: {
dataset: {
notificationId: '123',
priority: '0',
title: 'Test',
},
},
jsEvent: null,
resource: {
id: '123',
},
event: null,
oldEvent: null,
};
cy.get('.fc-event') // selector for the external event I want to drag in the calendar
.trigger('dragstart')
.get('.fc-time-grid table tr[data-time="07:00:00"] td.fc-widget-content:nth-child(2)') // selector for where I want to drop the event.
.trigger('drop', eventData) // this will fire the eventDrop event
So, .trigger('drop', eventData) will fill the eventDrop info. It is not exactly the same as doing it manually, but works for me.
Caveats:
I haven't found a way to plan it on another resource (we use the resource scheduling plugin of FullCalendar.io). It does not matter that much, because you can specify it in the evenData (resource: { id: 'my-resource-id' } }.
No visual feedback because the drag mirror is not shown. Not a big problem during e2e testing, but it is a bit of a blackbox now. Maybe this is fixable
I am struggling with including a custom map with custom data into Highmaps. I am sure it's a pretty dumb thing, but I just can't find any examples and explanations on the web.
I have a JSON file with the data, and a GeoJSON file with the map. So, it could look like this:
$(function ()
{
$.getJSON('http://xxx/data/P_.json', function (data)
{
// Initiate the chart
$('#container').highcharts('Map',
{
series : [
{
data : data,
mapData: 'http://www/data/countries.geojson',
joinBy: ['Name', 'Countries'],
}]
});
});
});
But something is quite obviously wrong. How do I add then the custom mapData?
Thanks for your help!
There is a instruction about how to create custom geoJSON: http://www.highcharts.com/docs/maps/custom-geojson-maps
In 9. there is link to jsFiddle that show how geoJSON file should be parsed to be used by Highcharts as mapData: http://jsfiddle.net/highcharts/xbzxfx2L/
$('#run').click(function () {
var geojson = $.parseJSON($('#geojson').val());
// Initiate the chart
$('#container').slideDown().highcharts('Map', {
series: [{
mapData: geojson
}]
});
});
I am using JVector map and marking some locations on the map using Markers.
According to the documentaiton the following code can be used to mark locations.
markers: [
{ latLng: [53.3574436, 9.9076650], name: 'some city' },
{ latLng: [53.3574436, 10.2127204], name: 'another city' },
{ latLng: [56.5611120, 24.0300030], name: 'one more city' }
]
In my case I am not sure how many locations I need to mark. Some times 3, some times 5. So what I want to know is, it is possible to Generate the code inside markers : [ ] dynamically with JSON. Or may be any other way?
You could add code with ClientScriptManager.RegisterClientScriptBlock
See: https://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerclientscriptblock(v=vs.140).aspx
Or you could do it inline in the markup with <% %> tags.
I am trying to implement a search form where the results would be displayed via a dojo 1.6 data grid. I have the rendering working, I make an ajax call on form submit and then build a Datagrid in the call back function using the ItemFileWriteStore.
function search()
{
var action = './search.json';
dojo.xhrPost({url: action, form:"searchForm",
load: function(result) {
var newStore = new dojo.data.ItemFileWriteStore({
data: {
identifier: "id",
items: JSON.parse(result),
url:'./search.json'
}
});
var grid = dijit.byId("searchResultsGrid");
if(grid == null) {
var layout = [[
{'name': 'Id', 'field': 'id', 'width': '50px'},
{'name': 'Name', 'field': 'name', 'width': '50px',editable: true,},
{'name': 'Source', 'field': 'source', 'width': '50px',editable: true,},
{'name': 'Version', 'field': 'version', 'width': '50px',editable: true,}
]];
var grid = new dojox.grid.DataGrid({
id: 'searchResultsGrid',
store: newStore,
structure: layout,
autoHeight:true, autoWidth:true, editable:true, columnReordering:true,
rowSelector: '20px'
});
grid.placeAt("gridDiv");
grid.startup();
}
else {
grid.setStore(newStore);
}
}
});
}
Now, when I try to make the grid editable and persist the changes to server, nothing happens with the ItemFileWriteStore. So I want to switch to JsonRestStore so that I can persist.
But the question is, how do I tie my form submit to the JsonRestStore or in other words is there a way to pass a dynamic query to the JsonRestStore ?
I want the JsonRestStore to fetch data on submit of my search form and based on the values in the search form.
Thanks in advance!
I would use the dojo.store.JsonRest store. In order to use the JsonRest store with dojox.grid.DataGrid, you will need to wrap it in a dojo.data.ObjecStore like below:
var newStore = new dojo.store.JsonRest({
target: '/search/',
idProperty: 'id'
});
newStore = new dojo.data.ObjectStore({
objectStore: newStore
});
Now the /search/ target should be your REST url. Your backend for /search/ should be able to support REST, which means you should be able to support GET, PUT, POST, DELETE requests. Take a look at http://dojotoolkit.org/reference-guide/1.10/quickstart/rest.html its for Dojo 1.10, but the method for implementing the backend should be similar.
Once you have the REST backend implemented to be able to retrieve and update data. You can send query parameters to the REST backend by setting the query parameter in the grid.
grid.setQuery({
param1: 1,
param2: 2
});
This will trigger the JsonRest store to use the url /search/?param1=1¶m2=2 to load the refresh set of data in the grid.
hai all,
i want to display datas from json store without using list....
then in url i want increment the page number...
i have following code in jsonstore....
Ext.regModel('message',{fields:['Drugid','Drugname','Manufacturer','Price','Unit','Catid']});
var store=new Ext.data.Store({
model: 'message',
proxy: {
type: 'ajax',
url: 'http://174.36.149.186/Medical/api/drugapi.php?op=mdrug&page=1',---- here i give just page is one,i want increment the page number
reader: {
type: 'json',
root: 'result.message'
}
},
autoLoad: true
});
i'm also new to sencha but maybe you could define an item template and add the template to a view just as you would eg. a textbox. the item template is declared just like an object and then passed to the view as the value of the itemtpl config attribute.
http://www.sencha.com/blog/dive-into-dataview-with-sencha-touch-2-beta-2/