Questions tagged [partial]

Existing only in part; incomplete.

Existing only in part; incomplete.

1478 questions
7
votes
2 answers

jquery load with asp.net MVC partial view

I have a partial view and I want to render it in main view using jquery. Here is how I am coding the jQuery: $(document).ready(function() { $("#dvGames").load("/LiveGame/Partial3"); }); where as controller method looks like this: public…
DotnetSparrow
  • 27,428
  • 62
  • 183
  • 316
7
votes
1 answer

Unexpected "Spread types may only be created from object types" error when using generics

I've got this typescript class that requires a generic type to be provided on construction: type Partial = { [P in keyof T]?: T[P]; }; class Foo { bis: Partial = {}; // (1) constructor() { console.log(typeof this.bis); //…
Olian04
  • 6,480
  • 2
  • 27
  • 54
7
votes
2 answers

Ruby on Rails: Render HTML partial as a one line of string

Is there a way to render a html.erb partial as a one line of string? I am trying to render a _foo.html.erb partial inside a javascript, such that I can use the whole html document as a string variable. I have tried the following code: var foo = "<%=…
DynamicScope
  • 695
  • 9
  • 26
7
votes
1 answer

Usage of functool.partialmethod and functool.partial?

Consider the following code: import functools import inspect class Foo: def foo_fn(self, hello, world): print(hello, world) class FooWrapper: def __init__(self, foo_class): self._foo = foo_class() for key, value in…
goldcode
  • 633
  • 8
  • 21
7
votes
7 answers

How to organise large code files?

I am increasingly aware that my code in any single file can often span hundreds of lines quite easily and although I know the implementation might be sound, it still feels messy and unorganised. I understand that there are situations where a lot of…
Nobody
  • 4,731
  • 7
  • 36
  • 65
7
votes
1 answer

Python regex partial extract

I want to find all data enclosed in [[ ]] these brackets. [[aaaaa]] -> aaaaa My python code (using re library) was la = re.findall(r'\[\[(.*?)\]\]', fa.read()) What if I want to extract only 'a' from [[a|b]] Any concise regular expression for…
SUNDONG
  • 2,501
  • 5
  • 21
  • 37
7
votes
5 answers

jQuery ready event not fired on partial page load

Here's the situ: A page which contains html and using the jQuery libray and tabs jQuery UI plugin loads another page when some tab is clicked. The problem is that when the page/html is loaded/rendered (let's simplify this and say it's just doing…
Mr AH
  • 71
  • 1
  • 1
  • 2
6
votes
2 answers

Stop ActiveRecord saving a serialized column even if not changed

This is very similar to Rails partial updates problem with hashes , but the question has not really been answered IMHO. The problem is this: I have a model with a serialized column: class Import < AR::Base serialize :data In my case, this data…
Martin T.
  • 3,132
  • 1
  • 30
  • 31
6
votes
1 answer

Symfony include partial from custom folder

Form example: $jobs)) ?> I have module job and partial _list.php in module folder templates. Is it possible create in templates folder partials and in include all partials from that folder? If it…
denys281
  • 2,004
  • 2
  • 19
  • 38
6
votes
1 answer

When is OnValidate called in Linq?

I want to implement this partial method in my Linq table class. partial void OnValidate(System.Data.Linq.ChangeAction action); My hope is that is it called right before an insert. Can anyone tell me when the OnValidate method is called? Update 1 I…
Anthony D
  • 10,877
  • 11
  • 46
  • 67
6
votes
1 answer

Why do Object.values for a Partial Record have undefined typings?

When extracting Object.values from a Partial Record, the values are a union between what I would expect and undefined. const example: Partial> = {} const values = Object.values(example) // strangely, the typing for values is…
Nathan
  • 73,987
  • 14
  • 40
  • 69
6
votes
3 answers

Rails: Show form from different model in a view

I have a location model and a post model. I want to allow the user to create new posts from the index page of the location model. How do I do that? I tried rendering the post new.html.erb as a partial in location index.html.erb, but this leads to…
ankit
  • 3,328
  • 3
  • 26
  • 39
6
votes
2 answers

Can autofac do partial Resolve?

I seem to need this a lot. Let's say I have a class with constructor taking several arguments. Some of these can be resolved by registering components. But the rest are instances created during runtime (e.g. fetching an entity from database). Can…
Kugel
  • 19,354
  • 16
  • 71
  • 103
6
votes
1 answer

How to do OR search

I want to search for a partial first and last name match - for example in sql f_name LIKE J% OR l_name LIKE S% would match John Smith or John Henry or Harry Smith . I am assuming I may need to use the "$or" operator, I have this so far…
Scott Szretter
  • 3,938
  • 11
  • 57
  • 76
6
votes
1 answer

Partial refresh on Materialized View

We have a table TB_1 which has monthly and weekly data partitioned by monthly and weekly columns. We also have materialized view MV_1 inherited from the table TB_1. We would like to refresh the materialized view by certain weekly or monthly…
user416
  • 516
  • 3
  • 12
  • 34