In an web application using MVC4, c# and Razor, there is a cool searchbox functionality that I need to implement.
It has 3 stages:
type 3 characters and search for result
select result from autocomplete list
present result as a funny removable object
Here are images:
I know I can implement steps 1 and 2 by using jquery autocomplete:
http://jqueryui.com/autocomplete/#remote
However, I have no idea on how to do step 3.
The web application is in my possession, but since the code is not commented nor is it properly refactored, I have no idea on how to replicate this functionality, nor do I know where to look for it in the code.
Can someone help me?
After checking on ChrFin's suggestion I made a search on my own and found select2:
http://plugins.jquery.com/select2/
The project is currently using this, so I am going to keep it and give it a whirl.
In the meantime, ChrFin's suggestion should also be mentioned:
http://demos.telerik.com/kendo-ui/multiselect/serverfiltering
Thanks for the help!
Related
I'm trying to create a wpf application such as a movies library because i would like to manage and sort out my movies with a pretty interface.
I'd like to create a library with all my movies getting information from the web, but i don't know how very well.
I thought to get the information from a web site, for example imdb, but i don't know if it's legally to capture html from page to get the nested information.
It's my first desktop application and I would also like to know if it is necessary to create a database within the project and then create a setup project with specified script for deploy it.
Sorry for the confusion but i would like to know too much things :)
Thanks a lot in advance.
The legality of web scraping is a grey area. See my question, "Legality of Web Scraping vs Normal Use" and the corresponding answers for some insight.
Even if the legality is not a problem, web scraping is a flimsy approach because the webpage structure may change without notice, making your application suddenly useless until you update it to the new format. You are much better off using some sort of web API (if the site providing the information offers it).
Whether you need a database or not depends entirely on what your application will be doing and how you design it - it's not something any of us can tell you.
Same goes for the setup project - in fact I wouldn't worry about that until you actually have a working application. Take it step by step and keep the scope within control.
Yes I did not think about api.
It's a great idea, maybe use "themoviedb".
But if i create an application based on it, that has to show all the movies that you have stored on your hdd and get , for example, the posters, the description and the ranking, i have to create a database according to you?
Thanks a lot.
The link below explains exactly what I am trying to do, and I have used it as a guide for my implementation so far. I have two columns filled with panels that can be moved around or collapsed. In the end, I want to save the state information about each panel on drop(as soon as the user changes it) so that when each individual user leaves or logs off, everything is where they left it upon return. I am using jquery, and c#.net for my back-end, which from what I understand makes it very difficult to incorporate PHP. I am wondering if anyone knows how I can accomplish what is demonstrated in the link, but using a method that does not include PHP?
http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/
Thanks in advance
You seem a bit lost (nothing wrong about it), but since you're using C#, you should find a way in C# to access your database. PHP is just a server-side language you could use, but it means installing PHP on your server... and I don't think this is what you want/need.
I'm pretty sure, there are very nice tutorials on the web on how you can interact with your current DB (what are you using? MySQL?)
Basic tutorial for SQL with C# https://www.youtube.com/watch?v=1EpYqtSlOr8
I'm trying to implement a drag-n-drop fileupload to my website and found a piece of java called Dropzone.js, it holds everything i need . . . i just have no idea of how to use it!
So far I've been programming only in razor ASP.NET (c#) / HTML / CSS, but so far no javascript / jquery.
It's razor webpages, so no mvc.
Due to my current lack of knowledge in java, i apologize in advance but i'm stuck !!
What i'd like to know is:
I'f i've understood things correct, i should not modify Dropzone.js directly, i should use it as a library and integrate it in my other scripts, e.g. in another .js file. Correct?
Any help in this will be greatly appreciated.
Kind regards,
Daniel A. Rischel
.. Edited as per requested.
Well, you're wrong somewhat. It might not be related to the question but please note these scripts are JavaScript and
java != javascript
Got the point? :) Please try to note this in future. Also, Java code cannot be added to these server-side language, because java itself is a language. You can use JavaScript or its library (jQuery) and create some plugins.
I'f i've understood things correct, i should not modify Dropzone.js directly, i should use it as a library and integrate it in my other scripts, e.g. in another .js file. Correct?
True, you need to link this plugin dropzone.js to the site using
<script href="/link/to/dropzone.js"></script>
Then you'll use this script on the whole of the page where it is linked.
And you should never edit the source code of a plugin, untill or unless you know what you're doing. Because you might mess up with the code.
I'd really like to see some source code examples of what a single file drag-n-drop fileupload form would look like. I've googled extensively but not found something i can use yet.
Did you try to read their documentations? They have a good code explaination on the default (main) page of their website too. And really it depends on just the way you style it. Its just a plugin, you will need to add your own CSS code to style the form. This plugin won't style the form for you, all it will do is to handle the upload events and get back with the result. So, which means that form creation and elements is all upto you!
If there is a dummies tutorial in making this work, i'd really like to be pointed in the right direction!
There is no perfect answer to provide you with, however I will provide you with some basics
http://www.javascriptoo.com/dropzone-js
https://stackoverflow.com/questions/tagged/dropzone.js?sort=newest&pageSize=15 (stackoverflow tag)
In the second link, you can go and see what are the very basic of the issues that are handled with what code. Easy methods will be hanlded by you! You'll need some guidance in just the hard jobs. Good luck for that!
My suggestion for you is to first undertand and learn jQuery, then learn how to make ajax calls. After that you'll know how to create and handle the events. The basic code will be
$('input[type=file]').change(function () { // change in value
// send the file via ajax
}
http://jquery.com
This method will be best as you will know what code you're using and what it will do. Using plugin is easy method then this one. But my preference is with the second one; creating your own plugin.
HI I am pretty new in C# sphere. Been in php and JavaScript since the beginning of this year. I want to scrap posts and comments from a blog. The site is http://www.somewhereinblog.net
What I want to do is
1. I want to log in using a software
2. Then download the html
3. Then use regular expressions, xpath whatever comes handy to separate the contents of posts and comments
I been searching all over. Understood very little. Though I am quite sure I need to use 'htmlagilitypack'. I dont know how to add a library to c# console or form application. Can someone give me some help? I badly need this. And I am not too into C# just a week. So would be grateful if there is some detailed information. Waiting eagerly.
Thanks in advance brothers.
Using Webclient you can login and download
Instead html-agility-pack I like CsQuery because lets you use jQuery syntax inside a string in C# code, so you can download to a string the html, and search and do things in it like with jQuery and HTML page.
I would like to include into my project a lookup control. Example of this control here :
But I'm a simple student, and so I'm very poor :)
So do you know a free control like this for my mvc3 project ? Thanks in advance !
Google! Many sites embeds external search engines.
If you're looking to add a search engine to your web site, there are three things you need to thing about:
The index, which holds the search results. Lucene, Solr and Sphinx are examples of this.
The crawler, which gathers the results and puts them into the index
The ui to get the results back from the index.
The control you linked to seems to provide all three. For a free replacement, maybe have a look at something like http://www.searchblox.com/
One option is the jQuery UI "Autocomplete" plugin:
http://jqueryui.com/demos/autocomplete/
This doesn't integrate with MVC out of the box; you'd need to write a server side method to provide the content for the completion drop down.