Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to open empty spread sheet by default? #106

Open
srivasmca opened this issue Dec 13, 2016 · 0 comments
Open

how to open empty spread sheet by default? #106

srivasmca opened this issue Dec 13, 2016 · 0 comments

Comments

@srivasmca
Copy link

srivasmca commented Dec 13, 2016

when i open my project by default an empty spread sheet should be open.

$(function(){
               window.loadSheet = function (obj) {
                    var urls = {menuLeft: 'menu.left.html', menuRight: 'menu.right.html'}, results = {}, loadCount = 2, loaded = 0;
                      for(var type in urls) {
                       var tempUrl = urls[type];
                       $(document.createElement('div'))
                               .data('type', type)
                               .load(tempUrl, function() {
                           results[$(this).data('type')] = this.children[0];
                           loaded++;
                           if (loadCount == loaded) {
                               $('#sheet')
                                   .attr('class', 'jSParent')
                                   .sheet({
                                   	/* colMargin:25,
                                   	newColumnWidth: 140, */
                                   	minSize: {rows: 10, cols: 10},
                                       menuLeft: function() {
                                           var jS = this,
                                           menu = $(results.menuLeft);
                                           //Give anchors access to jS them
                                           menu.find('a').each(function() {
                                               this.jS = jS;
                                           });
                                           return menu;
                                       },
                                       menuRight: function (){
                                           var jS = this,
                                           //we want to be able to edit the html for the menu to make them multi-instance
                                           menu = $(results.menuRight);
                                           //Give anchors access to jS them
                                           menu.find('a').each(function() {
                                               this.jS = jS;
                                           });
                                           menu.find("select").each(function(){
                                           	this.jS = jS; 
                                           });
                                           return menu;
                                       }
                                   });
                           	}
                       	});
                   	} 
               	};
               loadSheet({});
           });

i did like above code but the problem is that when inserting rows into spread row index is not coming correctly(sequence is not updated).

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40016578-how-to-open-empty-spread-sheet-by-default?utm_campaign=plugin&utm_content=tracker%2F609152&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F609152&utm_medium=issues&utm_source=github).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant